|
@ -101,10 +101,9 @@ function mockResponses (route, targets) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (target) { |
|
|
if (target) { |
|
|
// debug('target response: %s', target.response)
|
|
|
|
|
|
if (t.isFunction(target.response)) { |
|
|
if (t.isFunction(target.response)) { |
|
|
const pathMatches = ctx.path.match(pathRe).slice(1) |
|
|
const pathMatches = ctx.path.match(pathRe).slice(1) |
|
|
target.response.apply(null, [ctx].concat(pathMatches)) |
|
|
|
|
|
|
|
|
return target.response.apply(null, [ctx].concat(pathMatches)) |
|
|
} else if (t.isPlainObject(target.response)) { |
|
|
} else if (t.isPlainObject(target.response)) { |
|
|
Object.assign(ctx.response, target.response) |
|
|
Object.assign(ctx.response, target.response) |
|
|
} else { |
|
|
} else { |
|
|