Skip to content

Commit d9565fe

Browse files
authored
perf(test): using swc (#77)
1 parent 4e50498 commit d9565fe

File tree

3 files changed

+186
-8
lines changed

3 files changed

+186
-8
lines changed

jest.config.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
module.exports = {
22
automock: false,
3-
globals: {
4-
"ts-jest": {
5-
tsconfig: "tsconfig.test.json",
6-
diagnostics: false,
7-
},
8-
},
93
moduleFileExtensions: ["js", "json", "jsx", "ts", "tsx", "node"],
104
roots: ["<rootDir>/src"],
115
testEnvironment: "node",
126
testMatch: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[tj]s?(x)"],
137
transform: {
14-
"^.+\\.tsx?$": "ts-jest",
8+
"^.+\\.(t|j)sx?$": "@swc/jest",
159
},
1610
unmockedModulePathPatterns: ["<rootDir>/node_modules/*"],
1711
};

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"test:code:gen": "pnpm ts ./scripts/testCodeGen.ts",
5151
"test:depcruise": "depcruise --validate .dependency-cruiser.js src",
5252
"test:eslint": "eslint \"src/**/*.{ts,tsx}\"",
53-
"test:jest": "jest -c ./jest.config.js",
53+
"test:jest": "jest -c ./jest.config.js --collect-coverage",
5454
"test:snapshot": "jest -c ./jest.snapshot.config.js",
5555
"ts": "ts-node -P tsconfig.build.json",
5656
"update:snapshot": "pnpm jest -c ./jest.snapshot.config.js --updateSnapshot",
@@ -71,6 +71,9 @@
7171
"devDependencies": {
7272
"@commitlint/cli": "12.1.1",
7373
"@commitlint/config-conventional": "12.1.1",
74+
"@swc/core": "^1.2.173",
75+
"@swc/helpers": "^0.3.8",
76+
"@swc/jest": "^0.2.20",
7477
"@types/chokidar": "2.1.3",
7578
"@types/jest": "26.0.22",
7679
"@types/js-yaml": "4.0.0",

pnpm-lock.yaml

Lines changed: 181 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)