-
Notifications
You must be signed in to change notification settings - Fork 491
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
WIP: Setup unit test code coverage using nyc
#3600
Conversation
68f0dc0
to
d7f9fa2
Compare
524196d
to
f5c90e4
Compare
Ugh this is being annoying. |
So @rjmholt istanbuljs/nyc#1381 repros on my Surface, without any symlinks. Looks like they messed up I'll split out a couple things from this and leave it WIP I guess. Sucks, I can't find another tool for JavaScript code coverage. @TylerLeonhardt do you have any suggestions? |
5376061
to
560db3c
Compare
nyc
nyc
Also run `npm update && npm dedupe`.
86090eb
to
aef3cad
Compare
This extends the public TypeScript configuration and sets it to check just our source files. The `all` setting must be `false` otherwise the tool crashes with an OOM because the test runner launches VS Code instances. The `.vscode-test` folder must be excluded or `nyc` will attempt to instrument Code's own sources. The `out` and `src` folders must both be included so that the TypeScript source mapping works (along with the `require` settings in the configuration and in Mocha). The coverage check is set to false because we'll enable failures for reduced coverage later. The Cobertura report is for Azure DevOps (cobertura) and a summary is printed to the console.
aef3cad
to
196ad40
Compare
Ok so at this point we are punting again. This branch produces a coverage report on my local macMini:
And so it should work in CI, but it doesn't. It only runs if we set I am far from the only person struggling with And despite eventually getting it working, the implementation in that extension's CI was eventually removed: dotnet/vscode-csharp#4506 (comment) To quote the maintainer directly:
While an overview of the Code Python extension looks like it uses Now theoretically, if we want to take one more try at this, we could pre-instrument the codebase dynamically after the test Code instance is launched by having Mocha use Babel to transpile the JavaScript and babel-plugin-istanbul to instrument the code, and then maybe Also here two Code extension with coverage examples, but they're out of date as far as I can tell: |
I don't think I'll get back to using Istanbul, it's sooo out of date. We'll do this another way. |
Resolves #3597.