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
This commit is contained in:
24
config/jest/jest.unit.config.js
Normal file
24
config/jest/jest.unit.config.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
rootDir: path.join(__dirname, '..', '..'),
|
||||
testEnvironment: 'jsdom',
|
||||
testMatch: [
|
||||
'**/test/unit/*.js?(x)',
|
||||
'**/test/unit/**/*.js?(x)',
|
||||
],
|
||||
// testMatch: ['**/test/unit/core/plugins/auth/actions.js'],
|
||||
setupFilesAfterEnv: ['<rootDir>/test/unit/setup.js'],
|
||||
testPathIgnorePatterns: [
|
||||
'<rootDir>/node_modules/',
|
||||
'<rootDir>/test/build-artifacts/',
|
||||
'<rootDir>/test/mocha',
|
||||
'<rootDir>/test/unit/setup.js',
|
||||
'<rootDir>/test/unit/xss/anchor-target-rel/online-validator-badge.jsx',
|
||||
'<rootDir>/test/unit/components/online-validator-badge.jsx',
|
||||
'<rootDir>/test/unit/components/live-response.jsx',
|
||||
],
|
||||
transformIgnorePatterns: [
|
||||
'/node_modules/(?!(react-syntax-highlighter)/)'
|
||||
]
|
||||
};
|
||||
Reference in New Issue
Block a user