Jest Test Suite Checklist: Post-Creation Workflow
Follow these steps after creating a new test suite to ensure tests are stable, reproducible across environments, and integrated into the CI pipeline.
1. Local Validation & Snapshot Generation
Perform these steps to ensure the local environment is consistent with the repository.
- Execute Full Test Suite Locally
Run the full test suite on your machine. This step ensures that all internal paths are correct and, most importantly, generates all required snapshots for the new tests.# Example command npx jest tests/{api}/{test-suite-name}.test.js --updateSnapshot
For full usage doc, see : https://github.com/PHPCreation/phpreaction-api-endpoints-tests/blob/main/usage.md#updating-snapshots
2. Version Control (Git)
Ensure all artifacts are captured in the repository before merging.
- Feature Commit
Commit the newly created test files and their corresponding snapshots together as a single functional unit of the feature. - Cache Update Commitment (If Applicable)
If your feature needed to update the generated cache and/or create new cache files, don’t forget to commit them as well.
3. Actions pipeline
Verify that the test suite is runnable and compatible with automated workflows.
-
Workflow Update
Make sure to add your tests to the list of runnable tests in the workflow file. These are separated by API, just like tests. They can be found here : -
Action Run Validation
Trigger a manual run of the GitHub Actions to confirm that the test suite passes.This will also automatically generate the Allure report (frontend for tests reports). You might have to check the
Display inputsof thetestjob to see it.
4. Internal Documentation
Finalize the process for the team.
- Centralized Documentation Update
Add a documentation for the newly created test suite.
You can place it with the other test docs : https://github.com/PHPCreation/frontend-documentation-react-nextjs13/tree/main/content/quality-assurance/tests/integrations/suite