Skip to content

Commit 76e7d5c

Browse files
committed
feat(config/jest): swc/jestswc-node/jest (supports tsconfig)
1 parent be54bb5 commit 76e7d5c

File tree

3 files changed

+616
-49
lines changed

3 files changed

+616
-49
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"start": "run-p start:*",
2727
"start:source": "yarn build:source --watch",
2828
"start:types": "tsc -b -w --preserveWatchOutput src/",
29-
"test": "node src test",
29+
"test": "SWC_NODE_PROJECT=src/tsconfig.json node src test",
3030
"test:update": "node src test --updateSnapshot",
3131
"validate": "node src validate",
3232
"prepare": "husky install"
@@ -53,8 +53,8 @@
5353
"@commitlint/cli": "^16.1.0",
5454
"@commitlint/config-conventional": "^16.2.1",
5555
"@commitlint/prompt": "^16.1.0",
56+
"@swc-node/jest": "^1.5.2",
5657
"@swc/core": "^1.2.248",
57-
"@swc/jest": "^0.2.22",
5858
"@types/jest": "^29.0.0",
5959
"@types/lodash.has": "^4.5.6",
6060
"@types/mkdirp": "^1.0.2",
@@ -83,6 +83,7 @@
8383
"glob": "^8.0.3",
8484
"is-ci": "^3.0.1",
8585
"jest": "^29.0.2",
86+
"jest-environment-jsdom": "^29.0.3",
8687
"jest-github-actions-reporter": "^1.0.3",
8788
"jest-watch-typeahead": "^2.1.1",
8889
"lint-staged": "^12.3.4",

src/config/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const jestConfig = {
4444
],
4545
),
4646
)
47-
: {'^.+\\.(t|j)sx?$': ['@swc/jest']},
47+
: {'^.+\\.(t|j)sx?$': ['@swc-node/jest']},
4848
coveragePathIgnorePatterns: [
4949
...ignores,
5050
'src/(umd|cjs|esm)-entry.js$',

0 commit comments

Comments
 (0)