Skip to content

Commit 9f2d6e3

Browse files
authored
workflow: use @swc/jest to improve unit test performance (#490)
* workflow: use @swc/jest replace babel-jest and ts-jest * workflow: reduce the jest matchTest scope * workflow(test): modify testMatch scope
1 parent 37a7670 commit 9f2d6e3

File tree

3 files changed

+333
-169
lines changed

3 files changed

+333
-169
lines changed

jest.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ module.exports = {
1919
// Change MODULE_NAME_HERE to your module that isn't being compiled
2020
'/node_modules/(?!(@garfish)).+\\.js$',
2121
],
22-
transform: { '\\.js$': ['babel-jest'], '\\.ts$': 'ts-jest' },
22+
transform: {
23+
'^.+\\.(t|j)sx?$': ['@swc/jest'],
24+
},
2325
rootDir: __dirname,
2426
testMatch: ['<rootDir>/packages/**/__tests__/**/*spec.[jt]s?(x)'],
25-
// testMatch: ['<rootDir>/packages/bridge/__tests__/**/*spec.[jt]s?(x)'],
2627
testPathIgnorePatterns: ['/node_modules/', '/dev/'],
2728
moduleNameMapper: {
2829
'@garfish/(.*)': '<rootDir>packages/$1/src',

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@
7979
"typescript": "4.4.3",
8080
"wait-on": "6.0.0",
8181
"workspace-tools": "0.16.2",
82-
"zx": "4.2.0"
82+
"zx": "4.2.0",
83+
"@swc/core": "^1.2.183",
84+
"@swc/jest": "^0.2.21"
8385
},
8486
"version": "1.5.3"
8587
}

0 commit comments

Comments
 (0)