-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Support in-place instrumentation (again) #1135
Comments
We require a link to a repository showing an example project where this not working. |
All you need to do is run nyc/lib/commands/instrument.js Lines 96 to 99 in 4bc9c14
I haven't committed the upgrade that breaks this because I need my coverage to work in the meantime. This is a feature request to support this again. |
@AndrewFinlay do you have any thoughts? I know this needs to be blocked if @DanTup If you provided a link to a repository which uses in-place instrumentation I might be able to suggest a better way. Maybe |
Many things are dangerous, but making them impossible is really restrictive. This feature used to work, and I'm running it on the output of TypeScript so there's really no problem. You could make a I did try for some time to make the new version work, but there many places reference this folder (such as all the VS Code test entry points) so I gave up and just rolled back (I'd already spent several hours trying to get this working again after adding webpack - after spending many hours getting it working the first time!). My setup is super-janky (for a whole host of reasons, involving VS Code, webpack, mismatched source map paths between packed/unpacked and some weird behaviour from nyc depending on which folder it's executed from within): Maybe it can be simplified, but everything I tried (even just trying to eliminate things like all those wonky |
Hi @DanTup & @coreyfarrell, I've been a bit busy of late so I've had to put my nyc work to the side. However it turns out the last thing I was working on back in mid May was a switch to allow in-place instrumentation, so I guess that means I agree with Dan that it's needed. It'll need a bit more work to get it finished with tests, I'll try and find some time to finish it off today. It should be suitable for a minor release when done. @coreyfarrell, I was originally thinking of naming the switch 'overwrite' with an alias of '-o', but I think I like Dan's name of 'force' better, your thoughts? |
@AndrewFinlay semver-major changes have already been committed to master, we're currently working towards nyc@15.0.0. I'm thinking |
This all sounds good to me! @AndrewFinlay it's not urgent for me to upgrade, so don't worry about rushing to finish this for me, as long as it's coming in the future it prevents me getting stuck on an old version :-) Thanks! |
@coreyfarrell, I was writing some documentation for this when it struck me that specifying the output directory for this command is a little redundant. So I'm wondering if the command should still be |
I would also like to see this feature, and I agree with @AndrewFinlay that |
@AndrewFinlay |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
-- comment to counter stalebot -- |
It used to be possible to instrument in-place, but this is rejected since #1007.
It's not clear from the PR why, but it broke things for me, and trying to use a different folder is complicated (because there are many paths into the JS folder).
I understand this can be risky, but in my case it's just the transpiled output of typescript. It'd be nice if this was supported, even if you had to pass an extra flag to opt-in to it.
The text was updated successfully, but these errors were encountered: