-
Notifications
You must be signed in to change notification settings - Fork 14
Front End Automated Testing
Whenever you write a component, it needs to come with a bunch of tests. Tests should be written in the front end's test directory.
Jest and Enzyme are the JS frameworks we use to write our tests.
Jest -> https://jestjs.io/en/ Enzyme -> https://airbnb.io/enzyme/docs/api/ React testing dependency -> https://github.com/testing-library/react-testing-library
What are the crucial things that change depending on some external influence? What can I easily break? What would break the application's expected behavior? Those are what you should write tests on. Dont test 3rd party library stuff.
This article outlines pretty great unit and more robust acceptance testing for functional components with react hooks: https://medium.com/@acesmndr/testing-react-functional-components-with-hooks-using-enzyme-f732124d320a