diff --git a/mock/mock-server.js b/mock/mock-server.js index fcb931ad..b29b7c3f 100644 --- a/mock/mock-server.js +++ b/mock/mock-server.js @@ -3,16 +3,16 @@ const bodyParser = require('body-parser') const chalk = require('chalk') function registerRoutes(app) { - let mockStartIndex + let mockLastIndex const { default: mocks } = require('./index.js') for (const mock of mocks) { app[mock.type](mock.url, mock.response) - mockStartIndex = app._router.stack.length + mockLastIndex = app._router.stack.length } const mockRoutesLength = Object.keys(mocks).length return { mockRoutesLength: mockRoutesLength, - mockStartIndex: mockStartIndex - mockRoutesLength + mockStartIndex: mockLastIndex - mockRoutesLength } }