From d5b767c3747b9e7f9afcbcecffb662843ca2a346 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Mon, 16 Oct 2017 16:33:08 +0900 Subject: Replace JavaScript Testing Framework from Mocha to Jest (#5412) --- package.json | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 93e254abc..cf8069e94 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,9 @@ "build:production": "cross-env RAILS_ENV=production ./bin/webpack", "manage:translations": "node ./config/webpack/translationRunner.js", "start": "node ./streaming/index.js", - "test": "npm run test:lint && npm run test:mocha", + "test": "npm run test:lint && npm run test:jest", "test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ spec/javascript/ streaming/", - "test:mocha": "cross-env NODE_ENV=test mocha --require ./spec/javascript/setup.js --compilers js:babel-register ./spec/javascript/components/**/*.test.js", + "test:jest": "cross-env NODE_ENV=test jest", "postinstall": "npm rebuild node-sass" }, "repository": { @@ -118,22 +118,36 @@ }, "devDependencies": { "babel-eslint": "^7.2.3", - "chai": "^4.1.0", - "chai-enzyme": "^0.8.0", "enzyme": "^3.0.0", "enzyme-adapter-react-16": "^1.0.0", "eslint": "^3.19.0", "eslint-plugin-jsx-a11y": "^4.0.0", "eslint-plugin-react": "^6.10.3", - "jsdom": "^11.1.0", - "mocha": "^3.4.1", + "jest": "^21.2.1", + "raf": "^3.4.0", "react-intl-translations-manager": "^5.0.0", "react-test-renderer": "^16.0.0", - "sinon": "^2.3.7", "webpack-dev-server": "^2.6.1", "yargs": "^8.0.2" }, "optionalDependencies": { "fsevents": "*" + }, + "jest": { + "projects": [ + "/app/javascript/mastodon" + ], + "testPathIgnorePatterns": [ + "/node_modules/", + "/vendor/", + "/config/", + "/log/", + "/public/", + "/tmp/" + ], + "setupFiles": [ + "raf/polyfill" + ], + "setupTestFrameworkScriptFile": "/app/javascript/mastodon/test_setup.js" } } -- cgit