Skip to content

Commit 3bbffe2

Browse files
authored
test: migrate to jest instead (#7)
1 parent 3c9af71 commit 3bbffe2

File tree

3 files changed

+1569
-461
lines changed

3 files changed

+1569
-461
lines changed

package.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
"build": "run-p 'build:*'",
3636
"build:tsc": "tsc -b src",
3737
"build:tsdown": "tsdown src/index.ts -d lib --dts --format cjs",
38-
"clean": "premove .type-coverage coverage dist lib '.*cache'",
39-
"dev": "vitest",
38+
"clean": "premove .eslintcache .stylelintcache .type-coverage coverage dist lib",
4039
"docs": "vite",
4140
"docs:build": "vite build",
4241
"format": "prettier --write .",
@@ -47,7 +46,7 @@
4746
"prepare": "simple-git-hooks && yarn-berry-deduplicate || exit 0",
4847
"release": "yarn build && clean-pkg-json && changeset publish",
4948
"serve": "vite preview",
50-
"test": "vitest run",
49+
"test": "yarn node --experimental-vm-modules $(yarn bin jest)",
5150
"typecov": "type-coverage",
5251
"version": "changeset version && yarn --no-immutable"
5352
},
@@ -65,17 +64,19 @@
6564
"@mdx-js/rollup": "^3.1.0",
6665
"@shikijs/rehype": "^3.7.0",
6766
"@size-limit/preset-small-lib": "^11.2.0",
67+
"@types/jest": "^30.0.0",
6868
"@types/mdx": "^2.0.13",
6969
"@types/node": "^22.16.0",
7070
"@types/react": "^19.1.8",
7171
"@types/react-dom": "^19.1.6",
7272
"@types/web": "^0.0.245",
7373
"@vercel/analytics": "^1.5.0",
7474
"@vitejs/plugin-react-swc": "^3.10.2",
75-
"@vitest/coverage-v8": "^3.2.4",
7675
"clean-pkg-json": "^1.3.0",
7776
"eslint": "^9.30.1",
77+
"eslint-plugin-jest": "^29.0.1",
7878
"github-markdown-css": "^5.8.1",
79+
"jest": "^30.0.4",
7980
"nano-staged": "^0.8.0",
8081
"npm-run-all2": "^8.0.4",
8182
"premove": "^4.0.0",
@@ -92,20 +93,25 @@
9293
"type-coverage": "^2.29.7",
9394
"typescript": "^5.8.3",
9495
"vite": "^7.0.2",
95-
"vitest": "^3.2.4",
9696
"yarn-berry-deduplicate": "^6.1.3"
9797
},
9898
"resolutions": {
9999
"prettier": "^3.6.2"
100100
},
101+
"jest": {
102+
"collectCoverage": true,
103+
"extensionsToTreatAsEsm": [
104+
".ts"
105+
],
106+
"moduleNameMapper": {
107+
"^oxc-jest$": "<rootDir>/src/index.ts"
108+
}
109+
},
101110
"typeCoverage": {
102111
"atLeast": 100,
103112
"cache": true,
104113
"detail": true,
105114
"ignoreAsAssertion": true,
106-
"ignoreFiles": [
107-
"**/*.d.ts"
108-
],
109115
"ignoreNonNullAssertion": true,
110116
"showRelativePath": true,
111117
"strict": true,

vitest.config.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)