Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Jest's test framework setup configuration file
The setup documentation (1) provides instruction for best practices on how to configure the library for a optimal and easy developer workflow. This includes a global configuration that has been placed within the `test` base directory named `setup.js` and will be loaded via Jest's `setupTestFrameworkScriptFile` option . Initially it imports the `react-testing-library/cleanup-after-each` script which will automatically execute `afterEach(cleanup)` for each test which prevents unnecessary boilerplate per test file and possible problems when the function is not called accidentally. It also imports `jest-dom/extend-expect` to automatically extend the `expect` global with jest-dom's custom matchers (2). References: (1) https://github.com/kentcdodds/react-testing-library#setup (2) https://github.com/gnapse/jest-dom#custom-matchers GH-39
- Loading branch information