mock responses.. example
This commit is contained in:
8
example/mock/mocks/tree.mock.js
Normal file
8
example/mock/mocks/tree.mock.js
Normal file
@ -0,0 +1,8 @@
|
||||
module.exports = [
|
||||
{
|
||||
response: {
|
||||
status: 200,
|
||||
body: { id: 2, name: 'eucalyptus', maxHeight: 210 }
|
||||
}
|
||||
}
|
||||
]
|
23
example/mock/mocks/trees.mock.js
Normal file
23
example/mock/mocks/trees.mock.js
Normal file
@ -0,0 +1,23 @@
|
||||
module.exports = [
|
||||
{
|
||||
request: {
|
||||
method: 'GET'
|
||||
},
|
||||
response: {
|
||||
status: 200,
|
||||
body: [
|
||||
{ id: 1, name: 'conifer', maxHeight: 115 },
|
||||
{ id: 2, name: 'eucalyptus', maxHeight: 210 }
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
request: {
|
||||
method: 'POST'
|
||||
},
|
||||
response: {
|
||||
status: 201,
|
||||
location: '/tree/1'
|
||||
}
|
||||
}
|
||||
]
|
Reference in New Issue
Block a user