mocks: docs, examples, tests
This commit is contained in:
@ -148,11 +148,11 @@ function localWebServer (options) {
|
||||
/* Mock Responses */
|
||||
options.mocks.forEach(mock => {
|
||||
if (mock.module) {
|
||||
mock.targets = require(path.join(options.static.root, mock.module))
|
||||
mock.responses = require(path.join(options.static.root, mock.module))
|
||||
}
|
||||
|
||||
if (mock.targets) {
|
||||
app.use(mw.mockResponses(mock.route, mock.targets))
|
||||
if (mock.responses) {
|
||||
app.use(mw.mockResponses(mock.route, mock.responses))
|
||||
} else if (mock.response) {
|
||||
mock.target = {
|
||||
request: mock.request,
|
||||
|
Reference in New Issue
Block a user