Skip to content

Commit 52f8f96

Browse files
authored
chore: migrate Jest to Vitest (#105)
fix: adapt to rebased plugin arg fixes
1 parent e3746af commit 52f8f96

32 files changed

+1139
-1872
lines changed

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
npx --no-install lint-staged
22
pnpm run ts:check
3-
pnpm run test --coverage --verbose=false
3+
pnpm run test:coverage

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pnpm test
151151
Run all the tests and generate a test coverage report with:
152152

153153
```bash
154-
pnpm test:cov
154+
pnpm test:coverage
155155
```
156156

157157
> **Note:** you can pass any jest argument at the end of both commands, this can be useful to specific run tests based
@@ -276,7 +276,7 @@ Before submitting a PR (pull request), verify that all checks pass:
276276
```
277277
4. **Unit Tests**
278278
```bash
279-
pnpm test:cov
279+
pnpm test:coverage
280280
```
281281
5. **Production Build Check**
282282
```bash
@@ -360,7 +360,7 @@ commands**:
360360
- **Unit Tests**: runs all tests and checks if test coverage meets the required threshold.
361361

362362
```bash
363-
pnpm test:cov
363+
pnpm test:coverage
364364
```
365365

366366
- **Build Check (Production)**: confirms that the client can successfully build for production.

jest.config.js

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

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
"prepare": "husky",
5858
"prettier:check": "prettier --check .",
5959
"prettier:write": "prettier --write .",
60-
"test": "jest --verbose",
61-
"test:cov": "jest --verbose --coverage",
60+
"test": "vitest run",
61+
"test:coverage": "vitest run --coverage",
6262
"ts:check": "tsc -p tsconfig.build.json --noEmit",
6363
"watch": "pnpm run build --watch",
6464
"prepack": "pnpm exec ./scripts/pre-pack.sh"
@@ -75,20 +75,19 @@
7575
"@strapi/eslint-config": "0.2.1",
7676
"@types/node": "^20",
7777
"@types/debug": "4.1.12",
78-
"@types/jest": "29.5.14",
7978
"@types/qs": "6.9.18",
79+
"@vitest/coverage-v8": "latest",
8080
"@typescript-eslint/eslint-plugin": "8.21.0",
8181
"@typescript-eslint/parser": "8.21.0",
8282
"eslint": "8.57.1",
8383
"eslint-plugin-import": "2.31.0",
8484
"husky": "9.1.7",
85-
"jest": "29.7.0",
8685
"lint-staged": "15.4.1",
8786
"prettier": "3.4.2",
8887
"rimraf": "6.0.1",
8988
"rollup": "4.31.0",
90-
"ts-jest": "29.2.5",
91-
"typescript": "5.7.3"
89+
"typescript": "5.7.3",
90+
"vitest": "^4.0.3"
9291
},
9392
"packageManager": "[email protected]",
9493
"engines": {

0 commit comments

Comments
 (0)