Skip to content

chore(type-utils): migrate from jest to vitest #10767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9d61f51
Install `vitest`
aryaemami59 Feb 3, 2025
8ef16f6
Rename `jest.config.js` to `vitest.config.mts`
aryaemami59 Feb 3, 2025
010340a
chore(type-utils): migrate to `vitest`
aryaemami59 Feb 3, 2025
3252855
Update `vitest` to version 3.0.8
aryaemami59 Mar 7, 2025
f919822
Fix Vitest config
aryaemami59 Mar 7, 2025
578be1f
Include `vitest.config.mts` in `tsconfig.spec.json`
aryaemami59 Mar 8, 2025
37ed9a8
Add `vitest.config.mts` files to ESLint configuration
aryaemami59 Mar 8, 2025
6e45f7e
Use `defineProject` instead of `defineConfig`
aryaemami59 Mar 10, 2025
d40ac84
Explicitly enable `resolveJsonModule`
aryaemami59 Mar 10, 2025
167178b
Use `.replace` instead of `.split`
aryaemami59 Mar 10, 2025
a8b0c66
Type check `vitest.config.mts` files using project references.
aryaemami59 Mar 10, 2025
af5caa4
Fix Vitest config
aryaemami59 Mar 12, 2025
a502477
Fix `typecheck` task
aryaemami59 Mar 16, 2025
e9b2248
Update `vitest` to version 3.0.9
aryaemami59 Mar 26, 2025
e759da4
Update `@vitest/eslint-plugin` to version 1.1.38
aryaemami59 Mar 26, 2025
1f44186
Update `vitest` to version 3.1.1
aryaemami59 Mar 31, 2025
4dd2332
Update `@vitest/eslint-plugin` to version 1.1.39
aryaemami59 Apr 2, 2025
ed9a35f
Fix `knip` config
aryaemami59 Apr 3, 2025
777707e
Update `vite` to version 6.2.5
aryaemami59 Apr 3, 2025
dbd6f2a
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 7, 2025
b9e58ef
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 7, 2025
f8fc004
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 10, 2025
99133cd
Update `vite` to version 6.2.6
aryaemami59 Apr 10, 2025
e71694d
Update `@vitest/eslint-plugin` to version 1.1.40
aryaemami59 Apr 10, 2025
edad3d2
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 10, 2025
19fa3da
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
d938588
Update `@vitest/eslint-plugin` to version 1.1.42
aryaemami59 Apr 11, 2025
b270084
Enable the new `vitest/prefer-describe-function-title` rule
aryaemami59 Apr 11, 2025
71798a3
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
14f14e2
Use `vitestPlugin.configs.env`
aryaemami59 Apr 11, 2025
1658bcd
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
945f599
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
03a7cf4
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
60b6c60
Run `ast-spec:typecheck` during `postinstall`
aryaemami59 Apr 11, 2025
bddd2be
Fix `ast-spec:test`
aryaemami59 Apr 11, 2025
a1e534f
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
d57f66b
Fix `ast-spec:build`
aryaemami59 Apr 11, 2025
d4f77e9
Try disabling remote cache
aryaemami59 Apr 12, 2025
7137af9
Try disabling remote cache
aryaemami59 Apr 12, 2025
971aec3
Update `typecheck` output path in `nx.json`
aryaemami59 Apr 12, 2025
b40e037
Set `testTimeout` to `10_000`
aryaemami59 Apr 12, 2025
7af2d6f
Switch to `it.for`
aryaemami59 Apr 12, 2025
7d7d5b2
Fix `vitest` coverage output when run with `nx`
aryaemami59 Apr 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const vitestFiles = [
'packages/parser/tests/lib/**/*.test.{ts,tsx,cts,mts}',
'packages/parser/tests/test-utils/**/*.{ts,tsx,cts,mts}',
'packages/utils/tests/**/*.test?(-d).{ts,tsx,cts,mts}',
'packages/type-utils/tests/**/*.test.{ts,tsx,cts,mts}',
];

export default tseslint.config(
Expand Down
7 changes: 3 additions & 4 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,11 @@
"{workspaceRoot}/vitest.config.base.mts",
"{projectRoot}/vitest.config.mts"
],
"outputs": ["{options.reportsDirectory}"],
"outputs": ["{projectRoot}/coverage"],
"cache": true,
"options": {
"config": "{projectRoot}/vitest.config.mts",
"watch": false,
"reportsDirectory": "{projectRoot}/coverage"
"watch": false
}
},
"lint": {
Expand All @@ -132,7 +131,7 @@
},
"typecheck": {
"dependsOn": ["types:copy-ast-spec"],
"outputs": ["{workspaceRoot}/dist/out-tsc/{projectRoot}"],
"outputs": ["{workspaceRoot}/dist"],
"cache": true
}
},
Expand Down
12 changes: 6 additions & 6 deletions packages/ast-spec/project.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "ast-spec",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"type": "library",
"projectType": "library",
"implicitDependencies": ["!typescript-estree"],
"root": "packages/ast-spec",
"sourceRoot": "packages/ast-spec/src",
"targets": {
"build": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/ast-spec",
"commands": ["yarn build"]
},
"outputs": ["{projectRoot}/dist/**/*.ts"]
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"dependsOn": ["typecheck"]
},
"typecheck": {
"dependsOn": ["typescript-estree:build"]
}
Expand Down
7 changes: 0 additions & 7 deletions packages/type-utils/jest.config.js

This file was deleted.

10 changes: 5 additions & 5 deletions packages/type-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"build": "tsc -b tsconfig.build.json",
"postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3",
"clean": "tsc -b tsconfig.build.json --clean",
"postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage",
"postclean": "rimraf dist/ _ts4.3/ coverage/",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "npx nx lint",
"test": "jest",
"test": "vitest --run --config=$INIT_CWD/vitest.config.mts",
"check-types": "npx nx typecheck"
},
"dependencies": {
Expand All @@ -57,14 +57,14 @@
"typescript": ">=4.8.4 <5.9.0"
},
"devDependencies": {
"@jest/types": "29.6.3",
"@typescript-eslint/parser": "8.29.1",
"@vitest/coverage-v8": "^3.1.1",
"ajv": "^6.12.6",
"downlevel-dts": "*",
"jest": "29.7.0",
"prettier": "^3.2.5",
"rimraf": "*",
"typescript": "*"
"typescript": "*",
"vitest": "^3.1.1"
},
"funding": {
"type": "opencollective",
Expand Down
8 changes: 6 additions & 2 deletions packages/type-utils/project.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"name": "type-utils",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"type": "library",
"implicitDependencies": [],
"projectType": "library",
"root": "packages/type-utils",
"sourceRoot": "packages/type-utils/src",
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/vite:test"
}
}
}
Loading