diff --git a/docs/testing/converting-old-tests.md b/docs/testing/converting-old-tests.md index 6629109341..9a6d3d54b4 100644 --- a/docs/testing/converting-old-tests.md +++ b/docs/testing/converting-old-tests.md @@ -7,11 +7,11 @@ order: 4 ## Converting old tests This guide explains how to convert current InstUI tests written with the `@instructure/ui-test-utils` testing library to -use Jest + React Testing Library. +use Vitest + React Testing Library. -### Running Jest +### Running Vitest -Jest can be run from the project root with the `npm run test:new` command. It's configured in our CI pipeline so pushing a +Vitest can be run from the project root with the `npm run test:vitest` command. It's configured in our CI pipeline so pushing a branch to remote runs these tests together with the legacy tests automatically. ### Adding new tests to a package diff --git a/docs/testing/writing-tests.md b/docs/testing/writing-tests.md index aa6b7a4e5b..723905d5c7 100644 --- a/docs/testing/writing-tests.md +++ b/docs/testing/writing-tests.md @@ -5,7 +5,7 @@ order: 3 --- > This section uses [`@instructure/ui-test-utils`](/#ui-test-utils) testing library which will be sunset in our next -> release in favor of Jest + React Testing Library. See [our guide](/#converting-old-tests) on how to convert legacy tests to use the new +> release in favor of Vitest + React Testing Library. See [our guide](/#converting-old-tests) on how to convert legacy tests to use the new > frameworks. ## The anatomy of a test diff --git a/package-lock.json b/package-lock.json index 969d426341..e05770c56d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41639,7 +41639,11 @@ "@instructure/ui-test-locator": "9.1.0", "@instructure/ui-test-utils": "9.1.0", "@instructure/ui-themes": "9.1.0", +<<<<<<< HEAD >>>>>>> 4585fde55 (test(ui-avatar): remove jest) +======= + "@testing-library/jest-dom": "^6.4.5", +>>>>>>> 17c0d2ee6 (docs: add watch mode for vitest and modify docs) "@testing-library/react": "^15.0.7", "vitest": "^1.6.0" }, diff --git a/package.json b/package.json index 0d1b7730c0..37e08a4011 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "test": "ui-scripts test --randomize", "test:jest": "lerna run test:jest --stream", "cy:component": "cypress run --component", - "test:vitest": "vitest", + "test:vitest": "vitest --watch=false", + "test:vitest-watch": "vitest", "lint": "lerna run lint --stream", "lint:changes": "npm run lint -- --since HEAD^", "lint:fix": "lerna run lint:fix --stream",