You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+105Lines changed: 105 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -950,6 +950,111 @@ For example, we can use Polyfill.io to *only* polyfill FetchAPI:
950
950
- JSON Server
951
951
952
952
953
+
#### JSON Schema Faker
954
+
955
+
In order to emulate some behavior and make the test data more robust, we can employ a mocking library. In this case we used JSON Schema Faker to generate random test data based on a schema and then used that test data from our test page.
956
+
957
+
##### Details
958
+
959
+
1. Added functionality to `index.js` in order to make the `delete` links work next to each user
3. Now, the `getBaseUrl` function returns differently based on local vs. "Production"
1010
+
1. If the code is running locally, then in returns the JSON Server URL, `http://localhost:3001/`
1011
+
4. Finally, in order to generate the fake data on the fly each time the application is started, we need to modify the `package.json` file by adding some new functions
1012
+
1. We've created a script to generate the mock data, calling `generateMockData.js`
1013
+
2. We've created a start (and prestart) for starting up JSON Server, which serves up the generated data from `db.json` via the JSON Server URL (`http://localhost:3001/users`)
0 commit comments