RedditPP Mascot

RedditPP

r/webdev • … • u/FallingYields

How are you testing your Next.js application?

I'm setting up a new Next.js application and I'm trying to work out what testing frameworks to use.

I'll be writing unit/component tests and would like to also have integration tests.

I've previously used enzyme for react testing and some cobbled together selenium testing for e2e. As well as mocha, jasmine, chai for testing vanilla applications.

Next.js doesn't appear to be opinionated on this.

I see that Cypress has gotten really popular, but I can't tell if this is good for unit tests, or more of an integration e2e testing suite.

The docs say component testing suite in Cypress is in Alpha state, so I think I still need Enzyme to test that.

Thoughts on using Jest? I've never tried this testing suite.

My thinking is Enzyme and Cypress.

— 0