Skip to content

chore(types): migrate from jest to vitest #10776

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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0d6e3d2
Install `vitest`
aryaemami59 Feb 4, 2025
c07da99
Rename `jest.config.js` to `vitest.config.mts`
aryaemami59 Feb 4, 2025
c58b12a
chore(types): migrate to `vitest`
aryaemami59 Feb 4, 2025
995f754
Fix Vitest config
aryaemami59 Mar 7, 2025
ba55aa0
Include `vitest.config.mts` in `tsconfig.spec.json`
aryaemami59 Mar 8, 2025
3a978b8
Explicitly enable `resolveJsonModule`
aryaemami59 Mar 10, 2025
bf887f9
Use `.replace` instead of `.split`
aryaemami59 Mar 10, 2025
941f4b0
Type check `vitest.config.mts` files using project references.
aryaemami59 Mar 10, 2025
570bc20
Fix Vitest config
aryaemami59 Mar 12, 2025
15a8168
Update `vitest` to version 3.1.1
aryaemami59 Mar 31, 2025
0f0c80a
Update `@vitest/eslint-plugin` to version 1.1.39
aryaemami59 Apr 2, 2025
b9147ac
Fix `knip`
aryaemami59 Apr 3, 2025
6e15553
Update `vite` to version 6.2.5
aryaemami59 Apr 3, 2025
00bc1e0
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 7, 2025
a7a5230
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 7, 2025
30fdcc3
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 10, 2025
bc5539c
Update `vite` to version 6.2.6
aryaemami59 Apr 10, 2025
ed30de4
Update `@vitest/eslint-plugin` to version 1.1.40
aryaemami59 Apr 10, 2025
108e7fd
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 10, 2025
0f13f9b
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
dd2000c
Update `@vitest/eslint-plugin` to version 1.1.42
aryaemami59 Apr 11, 2025
a8b3173
Enable the new `vitest/prefer-describe-function-title` rule
aryaemami59 Apr 11, 2025
06d285b
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
02094b2
Use `vitestPlugin.configs.env`
aryaemami59 Apr 11, 2025
e2e0e5f
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
0a8e550
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
43a973f
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 12, 2025
5d39138
Try disabling remote cache
aryaemami59 Apr 12, 2025
3fdbdba
Try disabling remote cache
aryaemami59 Apr 12, 2025
0c88312
Try disabling remote cache
aryaemami59 Apr 12, 2025
03fff35
Run `ast-spec:typecheck` during `postinstall` script
aryaemami59 Apr 12, 2025
f73f94d
Update `typecheck` output path in `nx.json`
aryaemami59 Apr 12, 2025
aa8a887
Fix `vitest` coverage output when run with `nx`
aryaemami59 Apr 12, 2025
20f7c25
Merge branch 'main'
JoshuaKGoldberg Apr 15, 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 @@ -44,6 +44,7 @@ const vitestFiles = [
'packages/scope-manager/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/scope-manager/tests/test-utils/serializers/index.ts',
'packages/type-utils/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/types/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/typescript-eslint/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/typescript-estree/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/utils/tests/**/*.test?(-d).{ts,tsx,cts,mts}',
Expand Down
5 changes: 4 additions & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"generate-lib": "npx nx run scope-manager:generate-lib",
"lint": "npx nx lint",
"test": "vitest --run --config=$INIT_CWD/vitest.config.mts",
"check-types": "npx nx typecheck"
},
"nx": {
Expand All @@ -66,10 +67,12 @@
}
},
"devDependencies": {
"@vitest/coverage-v8": "^3.1.1",
"prettier": "^3.2.5",
"rimraf": "*",
"tsx": "*",
"typescript": "*"
"typescript": "*",
"vitest": "^3.1.1"
},
"funding": {
"type": "opencollective",
Expand Down
4 changes: 3 additions & 1 deletion packages/types/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "types",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"type": "library",
"projectType": "library",
"root": "packages/types",
"sourceRoot": "packages/types/src",
"implicitDependencies": ["ast-spec"],
"targets": {
"lint": {
Expand Down
20 changes: 20 additions & 0 deletions packages/types/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig, mergeConfig } from 'vitest/config';

import { vitestBaseConfig } from '../../vitest.config.base.mjs';
import packageJson from './package.json' with { type: 'json' };

const vitestConfig = mergeConfig(
vitestBaseConfig,

defineConfig({
root: import.meta.dirname,

test: {
name: packageJson.name.replace('@typescript-eslint/', ''),
root: import.meta.dirname,
passWithNoTests: true,
},
}),
);

export default vitestConfig;
2 changes: 2 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6131,10 +6131,12 @@ __metadata:
version: 0.0.0-use.local
resolution: "@typescript-eslint/types@workspace:packages/types"
dependencies:
"@vitest/coverage-v8": ^3.1.1
prettier: ^3.2.5
rimraf: "*"
tsx: "*"
typescript: "*"
vitest: ^3.1.1
languageName: unknown
linkType: soft

Expand Down