What makes a good frontend test? 37 tips and tricks to use to write better frontend tests
howtotestfrontend.com·4d·
Discuss: Hacker News
🧬Mutation Testing
Preview
Report Post

I love working with tests. It is always a fun process writing a test, and then updating the code to get the test to pass and go green.

But there is nothing more frustrating than trying to figure out what some existing tests were doing. (Often, when I was the original author of those tests too!)

Here are all my tips for writing high quality frontend tests.

Some examples I’ve simplified by removing the frontend specific parts, just to make the point easier. This is a site all about testing frontend apps, but to be honest most clean testing principles apply to frontend or backend testing!

Good tests are clear about what they are testing

If you are testing a component, having separate test() (or it()) for different assertions makes it much easier to maintain.

Importan…

Similar Posts

Loading similar posts...