mocks: docs, examples, tests
This commit is contained in:
3
example/mock/mocks/data.json
Normal file
3
example/mock/mocks/data.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"one": "static data"
|
||||
}
|
@ -1,8 +1,5 @@
|
||||
module.exports = {
|
||||
response: function (ctx, id, name) {
|
||||
this.body = {
|
||||
id: id,
|
||||
name: name
|
||||
}
|
||||
ctx.body = `<h1>id: ${id}, name: ${name}</h1>`
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
const fs = require('fs')
|
||||
|
||||
module.exports = {
|
||||
response: {
|
||||
body: { id: 2, name: 'eucalyptus', maxHeight: 210 }
|
||||
body: fs.createReadStream(__filename)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user