Create React App uses Jest as its test runner. To prepare for this integration, we did a extensively documented here.
You can also use examples.
We recommend that you use expect() for assertions and jest.fn() for spies. If you are having issues with them please default configuration that Create React App uses for Jest can be overridden by adding any of the following supported keys to a Jest config in your package.json.
Supported overrides:
coverageReportersglobalSetupresetModulestransform.travis.yml file to your git repository.language: node_js
node_js:
- 8
cache:
directories:
- node_modules
script:
- npm run build
- npm test
ReactDOM.render()shallow() in Visual Studio Code, there is a Stack Overflow