generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
DevOpstype of development task related to Process, Github Actions, and Deploymenttype of development task related to Process, Github Actions, and DeploymentdependencyThe issue or reason why this issue is in the iceboxThe issue or reason why this issue is in the iceboxfeature: technical standardsaccessibility, usability, unit testing, etc.accessibility, usability, unit testing, etc.issue level: missingissue type I: requestSmallest type of issue; Typically can be completed by one personSmallest type of issue; Typically can be completed by one personpriority: mediumrole: developmentanything related to codeanything related to codesize: 3ptCan be done in 13-18 hoursCan be done in 13-18 hours
Milestone
Description
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
- install
vitestand@vitest/typesnpm packages - uninstall
jest - update scripts in package.json so running
npm run testusesvitestcommand instead ofreact-scripts test - update vite.config.ts file to add this to
defineConfigin addition to plugins- some projects would have a separate vitest.config.ts file, but don't think we need one in this case
- setupTests.js file already set up with
@testing-library/jest-domimport - Jest has their globals API enabled by default, but Vitest doesn't, so needs to be included in the config
- to replicate Jest's behavior of running hooks (like
beforeEach, used in input button/routing tests) sequentially in Vitest, you can configure Vitest's sequence.hooks to 'list' in the test object
test: {
globals: true,
environment: "jsdom",
setupFiles: "./src/setupTests.js",
sequence: {
hooks: 'list',
},
- update tsconfig.json to add
"types": ["vitest"],undercompilerOptions
Individual test files
- add
import { describe, test, expect, vi } from 'vitest'; - use
vi.fn()instead ofjest.fn()to mock functions
There may be additional updates needed based on the specifics of each test file, but this should get us most of the way there.
- handoff to add testing to CI/CD process #1603
- remove
dependency
The issue or reason why this issue is in the icebox label - add
ready for dev lead
task ready for dev lead to evaluate label - move to
new issue approvalcolumn
- remove
dependency
- handoff to document new tests #1669
- remove
dependency
The issue or reason why this issue is in the icebox label - add
ready for dev lead
task ready for dev lead to evaluate label - move to
new issue approvalcolumn
- remove
dependency
Resources/Notes
Metadata
Metadata
Assignees
Labels
DevOpstype of development task related to Process, Github Actions, and Deploymenttype of development task related to Process, Github Actions, and DeploymentdependencyThe issue or reason why this issue is in the iceboxThe issue or reason why this issue is in the iceboxfeature: technical standardsaccessibility, usability, unit testing, etc.accessibility, usability, unit testing, etc.issue level: missingissue type I: requestSmallest type of issue; Typically can be completed by one personSmallest type of issue; Typically can be completed by one personpriority: mediumrole: developmentanything related to codeanything related to codesize: 3ptCan be done in 13-18 hoursCan be done in 13-18 hours
Type
Projects
Status
Icebox