nyc: Files get ignored from coverage when esnext bigint is used.
Steps to reproduce.
- Have working nyc setup.
- Edit a file that already appeared in coverage info, and add the following function:
function foo() {
return 5n;
}
Result is that the file disappears.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 16 (11 by maintainers)
@kmdrGroch @novemberborn @evert @wzalazar starting with nyc@14.1.0 the bigInt parser is enabled by default. Moving forward we intend to add parser plugins for any stage-3 feature which is supported by any released version of node.js (shortly after the new releases). That means nyc@14.1.0 also supports class properties (public and private).
This new version of nyc version is currently released to npm under
next
tag for testing.CC @kmdrGroch @novemberborn @evert @wzalazar FYI in
nyc@14.0.0
the optionplugins
is being renamed toparser-plugins
, see #1031. This will be listed under breaking changes in the CHANGELOG.md.@coreyfarrell as BigInts are in Node.js now, we should probably turn this on by default right?
You do not need nyc to
"require": "@babel/register"
for this, I’d recommend against it unless you are using babel for other reasons. What you need is to add"plugins": ["bigInt"]
to your nyc options. This option expects babel parser plugins, not babel plugins.If you are still having trouble please post a new ticket with a link to a repository demonstrating the problem.
Glad it’s working for you.
.nycrc
definitely is not included. I thought that yourpackage.json
would be included but looking at the code forcaching-transform
I’m not confident. Command-line arguments definitely are not included.Agreed in hindsight,
parser-plugins
would have been better. @bcoe @JaKXz can we do anything about this or is it too late? Maybe we can create an alias for now, delete theplugins
option from nyc@14?#948 adds support for configuring the babel parser plugins to be used. This will be included in the next release and will allow you to add the
bigInt
parser. You can follow #972 for a notification of the next release.https://babeljs.io/docs/en/babel-parser#plugins