Skip to content

Commit 0ab5231

Browse files
authored
chore: Jest to Vitest Migration (#4762)
* quick migration complete * fixing up the snapshots doubling up * fixing formating on test-setup.ts * updating vitest.config.ts * removing unused jest residue * fixing the test:dev script * updating yarn lock * adding jsdom as a dev dependency
1 parent 423d46e commit 0ab5231

File tree

11 files changed

+684
-1268
lines changed

11 files changed

+684
-1268
lines changed

jest.config.js

-76
This file was deleted.

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"scripts": {
55
"clean": "npm exec --workspaces -c \"rm -rf build || true\"",
66
"test": "(is-ci && npm run test:ci) || npm run test:dev",
7-
"test:ci": "jest",
8-
"test:dev": "jest --watch",
7+
"test:ci": "vitest",
8+
"test:dev": "vitest --watch",
99
"build": "rollup --config rollup.config.js && npm run typecheck",
1010
"watch": "concurrently --kill-others \"rollup --config rollup.config.js -w\" \"tsc -b --watch\"",
1111
"linkAll": "lerna exec 'npm link' --parallel",
@@ -93,7 +93,7 @@
9393
"concurrently": "^7.1.0",
9494
"current-git-branch": "^1.1.0",
9595
"git-log-parser": "^1.2.0",
96-
"jest": "^27.5.1",
96+
"jsdom": "^21.1.1",
9797
"lerna": "^4.0.0",
9898
"luxon": "^2.3.2",
9999
"prettier": "^2.6.2",
@@ -110,6 +110,7 @@
110110
"svelte": "^3.49.0",
111111
"ts-node": "^10.7.0",
112112
"typescript": "^4.7.4",
113+
"vitest": "^0.29.3",
113114
"vue": "^3.2.33"
114115
}
115116
}

packages/match-sorter-utils/__tests__/jest.setup.js

-2
This file was deleted.

packages/react-table-devtools/__tests__/jest.setup.js

-2
This file was deleted.

packages/react-table/__tests__/core/__snapshots__/core.test.tsx.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`core renders a table with markup 1`] = `
3+
exports[`core > renders a table with markup 1`] = `
44
[
55
[
66
[
@@ -59,7 +59,7 @@ exports[`core renders a table with markup 1`] = `
5959
]
6060
`;
6161

62-
exports[`core renders a table with markup 2`] = `
62+
exports[`core > renders a table with markup 2`] = `
6363
[
6464
[
6565
"tanner",
@@ -88,7 +88,7 @@ exports[`core renders a table with markup 2`] = `
8888
]
8989
`;
9090

91-
exports[`core renders a table with markup 3`] = `
91+
exports[`core > renders a table with markup 3`] = `
9292
[
9393
[
9494
[

packages/react-table/__tests__/features/__snapshots__/Visibility.test.tsx.snap

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`useReactTable can toggle column visibility: 0 - after toggling all off 1`] = `
3+
exports[`useReactTable > can toggle column visibility > 0 - after toggling all off 1`] = `
44
{
55
"footers": [
66
[],
@@ -20,7 +20,7 @@ exports[`useReactTable can toggle column visibility: 0 - after toggling all off
2020
}
2121
`;
2222

23-
exports[`useReactTable can toggle column visibility: 1 - after toggling all on 1`] = `
23+
exports[`useReactTable > can toggle column visibility > 1 - after toggling all on 1`] = `
2424
{
2525
"footers": [
2626
[
@@ -163,7 +163,7 @@ exports[`useReactTable can toggle column visibility: 1 - after toggling all on 1
163163
}
164164
`;
165165

166-
exports[`useReactTable can toggle column visibility: 2 - after toggling firstName off 1`] = `
166+
exports[`useReactTable > can toggle column visibility > 2 - after toggling firstName off 1`] = `
167167
{
168168
"footers": [
169169
[
@@ -287,7 +287,7 @@ exports[`useReactTable can toggle column visibility: 2 - after toggling firstNam
287287
}
288288
`;
289289

290-
exports[`useReactTable can toggle column visibility: 3 - after toggling More Info off 1`] = `
290+
exports[`useReactTable > can toggle column visibility > 3 - after toggling More Info off 1`] = `
291291
{
292292
"footers": [
293293
[

packages/react-table/__tests__/jest.setup.js

-2
This file was deleted.

packages/table-core/__tests__/jest.setup.js

-2
This file was deleted.

test-setup.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@testing-library/jest-dom'

vitest.config.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from 'vitest/config'
2+
3+
export default defineConfig({
4+
test: {
5+
watch: false,
6+
setupFiles: ['test-setup.ts'],
7+
environment: 'jsdom',
8+
globals: true,
9+
dir: 'packages'
10+
}
11+
})

0 commit comments

Comments
 (0)