diff options
author | François Freitag <mail@franek.fr> | 2021-05-29 23:53:04 +0200 |
---|---|---|
committer | François Freitag <mail@franek.fr> | 2021-05-30 10:44:34 +0200 |
commit | b0847abcc2c55614050951264c906920abd7634f (patch) | |
tree | 2d5d91417b99fad42ca40a08c068d39468dceb7c /package.json | |
parent | 8b3fbe1f0631e9be0844e84210be51cc8a847efd (diff) | |
download | nextcloud-server-b0847abcc2c55614050951264c906920abd7634f.tar.gz nextcloud-server-b0847abcc2c55614050951264c906920abd7634f.zip |
Rewrite requesttoken.spec.js with Jest
[Jest](https://jestjs.io/) is a test runner that focuses on simplicity.
It instruments babel to transform modules and test them.
Using Jest simplifies the existing configuration and allows dropping a
bunch of workarounds, as well as following the shared Babel
configuration for new code.
Signed-off-by: François Freitag <mail@franek.fr>
Diffstat (limited to 'package.json')
-rw-r--r-- | package.json | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/package.json b/package.json index 66e6babc764..da90c030626 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "watch": "NODE_ENV=development webpack --progress --watch --config webpack.dev.js", "lint": "eslint '**/src/**/*.{vue,js}'", "lint:fix": "eslint '**/src/**/*.{vue,js}' --fix", - "test": "mochapack --webpack-config core/webpack.test.js --require core/src/tests/setup.js \"core/src/tests/**/*.spec.js\"", - "test:watch": "mochapack -w --webpack-config core/webpack.test.js --require core/src/tests/setup.js \"core/src/tests/**/*.spec.js\"" + "test": "jest", + "test:watch": "jest --watch" }, "repository": { "type": "git", @@ -94,13 +94,14 @@ "@babel/plugin-proposal-class-properties": "^7.13.0", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/preset-env": "^7.13.15", + "@nextcloud/babel-config": "^1.0.0-beta.1", "@nextcloud/browserslist-config": "^2.1.0", "@nextcloud/eslint-config": "^2.2.0", "@nextcloud/eslint-plugin": "^1.5.0", "babel-eslint": "^10.1.0", + "babel-jest": "^26.6.3", "babel-loader": "^8.2.2", "babel-loader-exclude-node-modules-except": "^1.1.2", - "chai": "^4.3.4", "css-loader": "^5.2.6", "eslint": "^6.8.0", "eslint-config-standard": "^14.1.1", @@ -113,14 +114,10 @@ "exports-loader": "^1.1.1", "file-loader": "^6.2.0", "handlebars-loader": "^1.7.1", + "jest": "^26.6.3", "jsdom": "^16.6.0", - "jsdom-global": "^3.0.2", - "mocha": "^8.3.2", - "mochapack": "^2.1.2", "sass": "^1.34.0", "sass-loader": "^10.1.1", - "sinon": "^11.1.1", - "sinon-chai": "^3.7.0", "style-loader": "^2.0.0", "url-loader": "^4.1.1", "vue-loader": "^15.9.7", @@ -135,5 +132,10 @@ ], "engines": { "node": ">=10.0.0" + }, + "jest": { + "transform": { + "^.+\\.js$": "<rootDir>/tests/jestBabelTransformer.js" + } } } |