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

instrumenter: Be more friendly to ts-node/register #336

Closed
coreyfarrell opened this issue Mar 13, 2019 · 0 comments
Closed

instrumenter: Be more friendly to ts-node/register #336

coreyfarrell opened this issue Mar 13, 2019 · 0 comments

Comments

@coreyfarrell
Copy link
Member

Per istanbuljs/nyc#1002 the instrumenter generates two pieces of code that are unfriendly to ts-node/register. One is easy to fix, coverageData.hash = hash; should not be set separately but should be included in the declaration of coverageData.

The second issue with new Function is more difficult. See b12a07e for source of var Function = function () {}.constructor;. I'm not sure if this can be fixed.

coreyfarrell added a commit that referenced this issue Apr 3, 2019
ts-node gets angry when coverageData.hash is set after coverageData is
declared, add it to the initial object instead of setting it separately.

Also only output `Function` if a replacement is found in scope.

Fixes #336
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 a pull request may close this issue.

1 participant