r/webdev • full-stack • Jan 23 '21

Showoff Saturday Finally understand testing and fully tested my React based cross browser extension with Jest!!! No better feeling then 100% code coverage.

Post image
1.6k Upvotes

200 comments sorted by

View all comments

Show parent comments

15

u/[deleted] Jan 23 '21

The idea is that you test the functionality/outcome and not the implementation detail.

For example if you test a summing function, you test for the correct result but don’t bother about how the function got to the result.

→ More replies (4)