Improve tests for JavaScript (#3496)

- Upgrade dependencies
    - chai (3.5.0 -> 4.0.1)
    - chai-enzyme (0.6.1 -> 0.7.1)
    - sinon (2.2.0 -> 2.3.2)
- Change extensions from .jsx to .js
- Don't assign `React` to `global`
- Check code format using ESLint
This commit is contained in:
Yamagishi Kazutoshi 2017-06-02 00:27:15 +09:00 committed by Eugen Rochko
parent 509b0cfafc
commit 39ea5c0e2e
9 changed files with 55 additions and 47 deletions

View file

@ -9,8 +9,8 @@
"start": "rimraf ./tmp/streaming && babel ./streaming/index.js --out-dir ./tmp && node ./tmp/streaming/index.js",
"storybook": "NODE_ENV=test start-storybook -p 9001 -c storybook",
"test": "npm run test:lint && npm run test:mocha",
"test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ storyboard/ streaming/",
"test:mocha": "NODE_ENV=test mocha --require ./spec/javascript/setup.js --compilers js:babel-register ./spec/javascript/components/*.test.jsx",
"test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ spec/javascript/ storyboard/ streaming/",
"test:mocha": "NODE_ENV=test mocha --require ./spec/javascript/setup.js --compilers js:babel-register ./spec/javascript/components/*.test.js",
"postinstall": "npm rebuild node-sass"
},
"repository": {
@ -116,8 +116,8 @@
"devDependencies": {
"@kadira/storybook": "^2.35.3",
"babel-eslint": "^7.2.3",
"chai": "^3.5.0",
"chai-enzyme": "^0.6.1",
"chai": "^4.0.1",
"chai-enzyme": "^0.7.1",
"enzyme": "^2.8.2",
"eslint": "^3.19.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
@ -127,7 +127,7 @@
"mocha": "^3.4.1",
"react-intl-translations-manager": "^5.0.0",
"react-test-renderer": "^15.5.4",
"sinon": "^2.2.0",
"sinon": "^2.3.2",
"webpack-dev-server": "^2.4.5"
},
"optionalDependencies": {