We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 035c7d7 commit 5dd98eaCopy full SHA for 5dd98ea
mock/mock-server.js
@@ -3,16 +3,16 @@ const bodyParser = require('body-parser')
3
const chalk = require('chalk')
4
5
function registerRoutes(app) {
6
- let mockStartIndex
+ let mockLastIndex
7
const { default: mocks } = require('./index.js')
8
for (const mock of mocks) {
9
app[mock.type](mock.url, mock.response)
10
- mockStartIndex = app._router.stack.length
+ mockLastIndex = app._router.stack.length
11
}
12
const mockRoutesLength = Object.keys(mocks).length
13
return {
14
mockRoutesLength: mockRoutesLength,
15
- mockStartIndex: mockStartIndex - mockRoutesLength
+ mockStartIndex: mockLastIndex - mockRoutesLength
16
17
18
0 commit comments