update test suites #1668
Labels
DevOps
type of development task related to Process, Github Actions, and Deployment
feature: technical standards
accessibility, usability, unit testing, etc.
issue level I: request
Smallest type of issue; Typically can be completed by one person
priority: medium
ready for dev lead
task ready for dev lead to evaluate
role: development
anything related to code
size: 3pt
Can be done in 13-18 hours
Milestone
Dependency
Overview
Create React App(CRA) deprecated and we had to migrate to Vite for future sustainability. However many of our test suites from #1241 use testing packages from CRA. We need to translate these test suites to use Vite-compatible tests.
Action Items
Update the test suites using the new test library:
Root folder
vitest
and@vitest/types
npm packagesjest
npm run test
usesvitest
command instead ofreact-scripts test
defineConfig
in addition to plugins@testing-library/jest-dom
importbeforeEach
, used in input button/routing tests) sequentially in Vitest, you can configure Vitest's sequence.hooks to 'list' in the test object"types": ["vitest"],
undercompilerOptions
Individual test files
import { describe, test, expect, vi } from 'vitest';
vi.fn()
instead ofjest.fn()
to mock functionsThere may be additional updates needed based on the specifics of each test file, but this should get us most of the way there.
new issue approval
columnnew issue approval
columnResources/Notes
Vitest - Jest migration docs
The text was updated successfully, but these errors were encountered: