- https://en.wikipedia.org/wiki/Test-driven_development
- https://www.valentinog.com/blog/testing-react/
- https://blog.usejournal.com/tdd-your-react-components-8c8ad60ce2cc
- https://medium.com/@qjli/how-to-mock-specific-module-function-in-jest-715e39a391f4
- Jest is a Javascript unit testing framework, used by Facebook to test services and React applications.
- Enzyme is a JavaScript Testing utility for React that makes it easier to assert, manipulate, and traverse your React Components’ output.
-
Add Jest
- yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react @babel/plugin-transform-runtime react-test-renderer
-
Set package.json
- {"test" : "jest"}
-
Setup babel.config.js
- module.exports = {presets: ['@babel/preset-env', '@babel/preset-react'],plugins: ['@babel/plugin-transform-runtime']};
-
Run yarn test
- Console Show "No tests found, exiting with code 1"
- ex. Mockchers.test.js
- ex. Link.react.test.js
- ex. Simulator.test.js
- Enres Platform Folder test