THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

perf[mock-server]: optimize variable name

tags/4.1.0
Pan 1 year ago
parent
commit
5dd98ea47f
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      mock/mock-server.js

+ 3
- 3
mock/mock-server.js View File

@@ -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
}
}



Loading…
Cancel
Save