Skip to content

Commit

Permalink
feat: add error.detail for request not matching next pending mock
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Feb 15, 2018
1 parent ba5c9a4 commit 16c448c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/request-validation-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ function requestValidationMiddleware (state, request, response, next) {

if (request.method !== nextFixtureMethod || request.path !== nextFixturePath) {
return response.status(404).json({
error: `${request.method} ${request.path} does not match next fixture: ${nextFixtureMethod} ${nextFixturePath}`
error: `${request.method} ${request.path} does not match next fixture: ${nextFixtureMethod} ${nextFixturePath}`,
detail: {
pending: mock.pending()
}
})
}

Expand Down

0 comments on commit 16c448c

Please sign in to comment.