Skip to content

Commit 5dd98ea

Browse files
committed
perf[mock-server]: optimize variable name
1 parent 035c7d7 commit 5dd98ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mock/mock-server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ const bodyParser = require('body-parser')
33
const chalk = require('chalk')
44

55
function registerRoutes(app) {
6-
let mockStartIndex
6+
let mockLastIndex
77
const { default: mocks } = require('./index.js')
88
for (const mock of mocks) {
99
app[mock.type](mock.url, mock.response)
10-
mockStartIndex = app._router.stack.length
10+
mockLastIndex = app._router.stack.length
1111
}
1212
const mockRoutesLength = Object.keys(mocks).length
1313
return {
1414
mockRoutesLength: mockRoutesLength,
15-
mockStartIndex: mockStartIndex - mockRoutesLength
15+
mockStartIndex: mockLastIndex - mockRoutesLength
1616
}
1717
}
1818

0 commit comments

Comments
 (0)