Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not instrument production code #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

dopry
Copy link

@dopry dopry commented Sep 29, 2020

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

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
@bahmutov
Copy link
Owner

Can you add notes about setting the NODE_ENV to development when running the tests?

@dopry
Copy link
Author

dopry commented Oct 5, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants