Browse Source

example

master
Lloyd Brookes 9 years ago
parent
commit
666d7851db
  1. 5
      example/mock/mocks/user.js

5
example/mock/mocks/user.js

@ -1,11 +1,8 @@
const users = require('./users.json') const users = require('./users.json')
function getUser(id) {
return users.find(user => user.id === Number(id))
}
/* responses for /users/:id */ /* responses for /users/:id */
const mockResponses = [ const mockResponses = [
/* don't support POST */
/* don't support POST here */
{ request: { method: 'POST' }, response: { status: 400 } }, { request: { method: 'POST' }, response: { status: 400 } },
/* for GET requests, return a particular user */ /* for GET requests, return a particular user */

Loading…
Cancel
Save