diff --git a/package.json b/package.json index 2e1e1a9..6227eae 100644 --- a/package.json +++ b/package.json @@ -27,11 +27,11 @@ "path-to-regexp": "^6.2.1" }, "devDependencies": { - "@kapouer/eslint-config": "^1.9.0", - "chai": "^4.3.7", - "mocha": "^10.2.0", + "@kapouer/eslint-config": "^2.0.0", + "chai": "^5.1.0", + "mocha": "^10.4.0", "nyc": "^15.1.0", - "sinon": "^15.0.1", + "sinon": "^17.0.1", "sinon-chai": "^3.7.0" }, "eslintConfig": { diff --git a/test/index.test.js b/test/index.test.js index 5b8bf5f..32b9c9b 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,9 +1,6 @@ -const chai = require('chai'); const sinon = require('sinon'); const sinonChai = require('sinon-chai'); -chai.use(sinonChai); -const { expect } = chai; const rewrite = require('../index'); describe('rewrite tests', () => { @@ -12,6 +9,14 @@ describe('rewrite tests', () => { let res; let next; + let expect; + + before(async () => { + const chai = await import('chai'); + chai.use(sinonChai); + expect = chai.expect; + }); + beforeEach(() => { req = { url: '/',