|Product Owner||Frances Haugenemail@example.com||[@frances]|
Adds the Jest testing framework to a React or React Native app. This includes:
- A default
jest.config.jsthat works for both React and React Native
- [Optional] Basic tests to make sure the app is functional as well as included snapshot tests
||Set to true if you would like generated tests to be created for you for the app.|
This module works with the
create-react-app block located here.
There's one example for this package:
with-tests- This example is generated with
generateTests: trueso it has the infrastructure as well as generated tests.
Module tests are defined using a
test/scenarios.yaml file. This file defines the set of example gigs that we generate as part of integration testing. To run all tests, run
yarn test at the root of this module.
Each scenario is generated in
test/scenario/<name> which you can then
cd into and run the actual app. For a scenario called
with-tests, this is done via:
cd test/scenario/with-tests yarn install # Run tests. yarn test # Start the app. yarn start