Skip to content

Commit

Permalink
feat(jest): add dependency and update config
Browse files Browse the repository at this point in the history
  • Loading branch information
jackw committed Mar 4, 2022
1 parent 178295b commit d67db6d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 15 additions & 2 deletions templates/common/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const path = require('path');
// WIP - reference https://github.com/swc-project/jest/tree/master/examples/react

module.exports = {
testEnvironment: 'jest-environment-jsdom',
Expand All @@ -8,6 +8,19 @@ module.exports = {
'<rootDir>/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}',
],
transform: {
'^.+\\.(t|j)sx?$': '@swc/jest',
'^.+\\.(t|j)sx?$': [
'@swc/jest',
{
sourceMaps: true,
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
decorators: false,
dynamicImport: true,
},
}
}
],
},
};
1 change: 1 addition & 0 deletions templates/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-webpack-plugin": "^3.1.1",
"jest": "27.5.0",
"fork-ts-checker-webpack-plugin": "^7.2.0",
"prettier": "^2.5.0",
"replace-in-file-webpack-plugin": "^1.0.6",
Expand Down

0 comments on commit d67db6d

Please sign in to comment.