Tag: Testing
All the articles with the tag "Testing".
How to Test Custom Hooks with React Testing Library and Jest
Updated: at 10:08 AMLearn how to test your custom React Hooks with React Testing Library and Jest. You'll find an interactive Codesandox at the end of the post.
How to test props in React Testing Library
Updated: at 12:00 PMMock the child with jest.mock and read the prop from the text. On Jest 30 the mock variable's name has to start with mock.
How to migrate from Mocha to Jest
Updated: at 02:46 PMMove a Mocha suite to Jest with small edits instead of rewriting tests, including JSDOM via Jest's testEnvironment and mocha.opts.
Why avoid testing implementation details
Updated: at 03:08 PMWhy tests that lock onto implementation details slow a project down, and what to assert so refactors stay safe.