Skip to content

Commit

Permalink
chore: Jest to Vitest Migration (#4762)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ZackDeRose committed Mar 19, 2023
1 parent 423d46e commit 0ab5231
Show file tree
Hide file tree
Showing 11 changed files with 684 additions and 1,268 deletions.
76 changes: 0 additions & 76 deletions jest.config.js

This file was deleted.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"scripts": {
"clean": "npm exec --workspaces -c \"rm -rf build || true\"",
"test": "(is-ci && npm run test:ci) || npm run test:dev",
"test:ci": "jest",
"test:dev": "jest --watch",
"test:ci": "vitest",
"test:dev": "vitest --watch",
"build": "rollup --config rollup.config.js && npm run typecheck",
"watch": "concurrently --kill-others \"rollup --config rollup.config.js -w\" \"tsc -b --watch\"",
"linkAll": "lerna exec 'npm link' --parallel",
Expand Down Expand Up @@ -93,7 +93,7 @@
"concurrently": "^7.1.0",
"current-git-branch": "^1.1.0",
"git-log-parser": "^1.2.0",
"jest": "^27.5.1",
"jsdom": "^21.1.1",
"lerna": "^4.0.0",
"luxon": "^2.3.2",
"prettier": "^2.6.2",
Expand All @@ -110,6 +110,7 @@
"svelte": "^3.49.0",
"ts-node": "^10.7.0",
"typescript": "^4.7.4",
"vitest": "^0.29.3",
"vue": "^3.2.33"
}
}
2 changes: 0 additions & 2 deletions packages/match-sorter-utils/__tests__/jest.setup.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/react-table-devtools/__tests__/jest.setup.js

This file was deleted.

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

exports[`core renders a table with markup 1`] = `
exports[`core > renders a table with markup 1`] = `
[
[
[
Expand Down Expand Up @@ -59,7 +59,7 @@ exports[`core renders a table with markup 1`] = `
]
`;

exports[`core renders a table with markup 2`] = `
exports[`core > renders a table with markup 2`] = `
[
[
"tanner",
Expand Down Expand Up @@ -88,7 +88,7 @@ exports[`core renders a table with markup 2`] = `
]
`;

exports[`core renders a table with markup 3`] = `
exports[`core > renders a table with markup 3`] = `
[
[
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`useReactTable can toggle column visibility: 0 - after toggling all off 1`] = `
exports[`useReactTable > can toggle column visibility > 0 - after toggling all off 1`] = `
{
"footers": [
[],
Expand All @@ -20,7 +20,7 @@ exports[`useReactTable can toggle column visibility: 0 - after toggling all off
}
`;

exports[`useReactTable can toggle column visibility: 1 - after toggling all on 1`] = `
exports[`useReactTable > can toggle column visibility > 1 - after toggling all on 1`] = `
{
"footers": [
[
Expand Down Expand Up @@ -163,7 +163,7 @@ exports[`useReactTable can toggle column visibility: 1 - after toggling all on 1
}
`;

exports[`useReactTable can toggle column visibility: 2 - after toggling firstName off 1`] = `
exports[`useReactTable > can toggle column visibility > 2 - after toggling firstName off 1`] = `
{
"footers": [
[
Expand Down Expand Up @@ -287,7 +287,7 @@ exports[`useReactTable can toggle column visibility: 2 - after toggling firstNam
}
`;

exports[`useReactTable can toggle column visibility: 3 - after toggling More Info off 1`] = `
exports[`useReactTable > can toggle column visibility > 3 - after toggling More Info off 1`] = `
{
"footers": [
[
Expand Down
2 changes: 0 additions & 2 deletions packages/react-table/__tests__/jest.setup.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/table-core/__tests__/jest.setup.js

This file was deleted.

1 change: 1 addition & 0 deletions test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom'
11 changes: 11 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
watch: false,
setupFiles: ['test-setup.ts'],
environment: 'jsdom',
globals: true,
dir: 'packages'
}
})

0 comments on commit 0ab5231

Please sign in to comment.