Skip to content

Commit 94241cd

Browse files
committed
touch up docs
1 parent 09e6f26 commit 94241cd

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

tests/dummy/app/pods/docs/network-mocking/template.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Network mocking
22

3-
Just about every Ember application ends up having pages that require data from an external API. It's common to use tools like [Mirage](https://www.ember-cli-mirage.com/) to mock the network when testing these applications.
3+
Just about every Ember application ends up having pages that depend on data from an external API. It's common to use tools like [Mirage](https://www.ember-cli-mirage.com/) to mock the network when testing these applications.
44

5-
It makes sense that we would also want to mock the network in FastBoot tests. However, since FastBoot runs inside of Node.js, we'll need to use a network mocking library that is written for node applications.
5+
It makes sense that we would also want to mock the network while running FastBoot tests. However, since FastBoot runs inside of Node.js, we'll need to use a network mocking library that is written for node.
66

7-
FastBoot Testing exposes an API for networking mocking in node that can be used to intercept requests made from your FastBoot app.
7+
FastBoot Testing exposes an API for intercepting requests made from your FastBoot app.
88

99
The following example shows how to mock a test that fetches blog post data.
1010

@@ -17,10 +17,12 @@ module('Fastboot | Blog post page', function(hooks) {
1717

1818
test('it can render a blog post', async function(assert) {
1919
await mockServer.get('/api/posts/1', {
20-
type: 'post',
21-
id: '1',
22-
attributes: {
23-
title: 'Hello world!'
20+
data: {
21+
type: 'post',
22+
id: '1',
23+
attributes: {
24+
title: 'Hello world!'
25+
}
2426
}
2527
});
2628

tests/dummy/app/serializers/application.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)