next-and-cypress-example
next-and-cypress-example copied to clipboard
Do not instrument production code
modify the .babelrc to only apply istanbul instrumentation to development code NODE_ENV is set to development when running next and next dev next build set NODE_ENV to production
Can you add notes about setting the NODE_ENV
to development when running the tests?
Next sets NODE_ENV to dev when running next dev.
see: https://github.com/vercel/next.js/blob/3e81809df44e5c36a52abc89b46bc53f18b83695/packages/next/bin/next.ts#L87
If just running next
you may need to pass it. I don't normally do this in testing. Did you just run next and the instrumentation didn't happen? Is this what I should clarify?