feat: migrate unit tests to Jest (#6353)
* config(jest): updated setup * config(jest): update testMatch to include jsx files * config(jest): add transformIgnorePatterns * config(jest): update ignore files that do not work in jest yet * config: add test:unit-jest to test script * fix(jest): lint with eslint-plugin-jest * refactor(jest): move unit test directory * refactor(mocha): restore mocha tests that fail in jest * docs(jest): update helpful scripts with test:unit-jest
Showing
config/jest/jest.unit.config.js
0 → 100644
... | ... | @@ -32,7 +32,7 @@ |
"lint": "eslint --cache --ext \".js,.jsx\" src test", | ||
"lint-errors": "eslint --cache --quiet --ext \".js,.jsx\" src test", | ||
"lint-fix": "eslint --cache --ext \".js,.jsx\" src test --fix", | ||
"test": "run-s just-test-in-node e2e-cypress lint-errors", | ||
"test": "run-s just-test-in-node test:unit-jest e2e-cypress lint-errors", | ||
"test-in-node": "run-s lint-errors just-test-in-node", | ||
"just-test-in-node": "cross-env BABEL_ENV=test mocha \"test/mocha/**/*.{js,jsx}\"", | ||
"test-e2e-cypress": "cypress run", | ||
... | ... | @@ -41,6 +41,7 @@ |
"test:artifact:umd:bundle": "npm run build-bundle && cross-env BABEL_ENV=commonjs jest --config ./config/jest/jest.artifact-umd-bundle.config.js", | ||
"test:artifact:es:bundle": "npm run build:es:bundle && cross-env BABEL_ENV=commonjs jest --config ./config/jest/jest.artifact-es-bundle.config.js", | ||
"test:artifact:es:bundle:core": "npm run build:es:bundle:core && cross-env BABEL_ENV=commonjs jest --config ./config/jest/jest.artifact-es-bundle-core.config.js", | ||
"test:unit-jest": "cross-env BABEL_ENV=test jest --config ./config/jest/jest.unit.config.js", | ||
"e2e-initial-render": "nightwatch test/e2e-selenium/scenarios/ --config test/e2e-selenium/nightwatch.json --group initial-render", | ||
"mock-api": "json-server --watch test/e2e-selenium/db.json --port 3204", | ||
"hot-e2e-cypress-server": "webpack-dev-server --config webpack/dev-e2e.babel.js --content-base test/e2e-cypress/static", | ||
... | ... | @@ -128,6 +129,7 @@ |
"enzyme": "^2.7.1", | ||
"eslint": "^4.1.1", | ||
"eslint-plugin-import": "^2.21.1", | ||
"eslint-plugin-jest": "=23.20.0", | ||
"eslint-plugin-mocha": "^6.3.0", | ||
"eslint-plugin-react": "^7.20.0", | ||
"esm": "=3.2.25", | ||
... | ... |
test/mocha/.eslinrc
0 → 100644
此差异已折叠。
test/unit/.eslintrc
0 → 100644
文件已移动
此差异已折叠。
test/unit/setup.js
0 → 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
想要评论请 注册 或 登录