Skip to content

Commit

Permalink
feat: migrate tests to jest (#34)
Browse files Browse the repository at this point in the history
* feat: migrate to jest

* feat: improve coverage

* chore: correct unit testing command

* chore: improve config, remove useless clearTimeout

* fixup! chore: correct unit testing command
  • Loading branch information
Juiced66 authored Nov 21, 2024
1 parent 31c7d11 commit bf45307
Show file tree
Hide file tree
Showing 12 changed files with 22,804 additions and 15,814 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"yoda": [2, "never"]
},
"env": {
"mocha": true,
"jest": true,
"node": true,
"es6": true
},
Expand Down
7 changes: 7 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
rootDir: '.',
testMatch: ['<rootDir>/tests/unit/**/*.test.js'],
setupFilesAfterEnv: ['<rootDir>/tests/setup/jest.setup.js'],
testEnvironment: 'node',
};

37,842 changes: 22,402 additions & 15,440 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"test": "npm run --silent lint && npm run unit-testing",
"lint": "eslint --max-warnings=0 ./lib",
"unit-testing": "./node_modules/.bin/mocha test/",
"unit-testing": "jest",
"doc-prepare": "kuzdoc framework:install",
"doc-dev": "kuzdoc repo:dev -d /official-plugins/s3/2/ -v 2",
"doc-build": "kuzdoc repo:build -d /official-plugins/s3/2/ -v 2",
Expand All @@ -33,16 +33,15 @@
},
"homepage": "https://github.com/kuzzleio/kuzzle-plugin-s3#readme",
"devDependencies": {
"@types/jest": "^29.5.14",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.46.0",
"jest": "^29.7.0",
"kuzdoc": "^2.5.4",
"kuzzle-common-objects": "^5.0.2",
"mocha": "^5.2.0",
"mock-require": "^3.0.3",
"rewire": "^6.0.0",
"should": "^13.2.3",
"should-sinon": "0.0.6",
"sinon": "^7.2.3"
"should-sinon": "0.0.6"
},
"dependencies": {
"@commitlint/cli": "^17.6.7",
Expand Down
Loading

0 comments on commit bf45307

Please sign in to comment.