Skip to content

Commit 6d740d7

Browse files
authored
feat: Use Vitest for testing (#8507)
1 parent 95459c4 commit 6d740d7

16 files changed

+1106
-2275
lines changed

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pnpm run pretty:check
22
pnpm run eslint
3-
pnpm run test --testPathIgnorePatterns ota.test.ts
3+
pnpm run test:coverage
44
pnpm run build

package.json

+6-33
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
"eslint": "eslint --max-warnings=0",
3131
"pretty:write": "prettier --write .",
3232
"pretty:check": "prettier --check .",
33-
"test": "jest test --silent --runInBand",
34-
"test:coverage": "jest test --silent --coverage --runInBand",
35-
"test-watch": "jest test --silent --watch --runInBand",
33+
"test": "vitest run --config ./test/vitest.config.mts",
34+
"test:coverage": "vitest run --config ./test/vitest.config.mts",
35+
"test:watch": "vitest watch --config ./test/vitest.config.mts",
3636
"clean": "rimraf --glob index* devices lib converters tsconfig.tsbuildinfo",
3737
"build": "tsc",
3838
"build-watch": "tsc --watch",
@@ -57,45 +57,18 @@
5757
"@ianvs/prettier-plugin-sort-imports": "^4.4.0",
5858
"@types/buffer-crc32": "^0.2.4",
5959
"@types/eslint__js": "^8.42.3",
60-
"@types/jest": "^29.5.14",
6160
"@types/node": "^22.10.2",
6261
"@types/semver": "^7.5.8",
62+
"@vitest/coverage-v8": "2.1.8",
6363
"eslint": "^9.17.0",
6464
"eslint-config-prettier": "^9.1.0",
6565
"fast-deep-equal": "^3.1.3",
6666
"husky": "^9.1.7",
67-
"jest": "^29.7.0",
6867
"prettier": "^3.4.2",
6968
"rimraf": "^6.0.1",
70-
"ts-jest": "^29.2.5",
7169
"ts-morph": "^24.0.0",
7270
"typescript": "^5.7.2",
73-
"typescript-eslint": "^8.18.0"
74-
},
75-
"jest": {
76-
"preset": "ts-jest",
77-
"testEnvironment": "node",
78-
"clearMocks": true,
79-
"collectCoverage": false,
80-
"coverageProvider": "babel",
81-
"coverageDirectory": "coverage",
82-
"cacheDirectory": ".jest-tmp",
83-
"collectCoverageFrom": [
84-
"src/lib/ota.ts"
85-
],
86-
"roots": [
87-
"test/",
88-
"src/"
89-
],
90-
"moduleFileExtensions": [
91-
"ts",
92-
"json",
93-
"js",
94-
"mjs",
95-
"cjs",
96-
"jsx",
97-
"tsx",
98-
"node"
99-
]
71+
"typescript-eslint": "^8.18.0",
72+
"vitest": "^2.1.8"
10073
}
10174
}

0 commit comments

Comments
 (0)