DEV Community

Discussion on: Things I learned after writing tests for JS and HTML page

Collapse
 
thawkin3 profile image
Tyler Hawkins

Thanks Yuki for writing this! I had a similar question of how to test an HTML file with vanilla JavaScript and no UI frameworks, and your article gave me a really good starting point.

I ended up finding a way to do this with Jest and Kent Dodd's DOM Testing Library, and I wrote about it here: dev.to/thawkin3/how-to-unit-test-h...

Collapse
 
snowleo208 profile image
Yuki Cheung

Yes, testing library is quite good and it forced you not to use shallow or create lots of mocks for different functions.

I am using react-testing-library currently and it is fantastic! It is great to learn how to write unit tests using testing library and learn those best practices :)