-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
--all with babel-plugin-istanbul does not report coverage for files not dependents of the test entries #911
Comments
I've seen an issue like this, I believe the problem is that {
"instrument": true,
"sourceMaps": false,
"all": true
} Obviously that conflicts with what is documented. I have not had a chance to investigate this further, the |
@hershmire are you still experiencing this with the latest version of nyc and Corey's suggestion? |
I know this is a bit of an older issue, but I am still seeing this same behavior in another repository. This time, both on I'm using the command I've got the following:
My {
"include": [
"src"
],
"reporter": [
"lcov",
"text-summary"
],
"require": [
"@babel/register"
],
"extension": [
".ts",
".tsx"
],
"all": true,
"instrument": false,
"sourceMap": false
} ...and const presets = [
[ '@babel/env', {
targets: {
node: true
}
}],
'@babel/typescript'
]
const plugins = [
'@babel/proposal-class-properties',
'@babel/proposal-object-rest-spread',
[ 'transform-es2015-modules-commonjs', {
noInterop: true
}]
]
exports = module.exports = {
comments: false,
compact: true,
env: {
test: {
plugins: [ 'istanbul' ]
}
},
plugins,
presets,
sourceMaps: true
} My directory structure, in short, looks like this:
In short, I'm trying to cover every TS file in Switching This looks like the same behavior as the original, with the same configuration (that is, |
@CynicalBusiness can you provide a link to a repository? |
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. |
`coverage` script would not fail below specified thresholds. See more at: istanbuljs/nyc#911
Really weird, but I managed to get it "working" by removing "nyc": {
- "require": [
- "@babel/register"
- ],
"sourceMap": false,
- "instrument": false,
+ "instrument": true,
"all": true
} Would be awesome if someone could update the tutorial. Note: I'm quoting working because I'm not sure if the lines of code are calculated correctly since I removed the require hook... 🤷♂️ |
Expected Behavior
When running NYC with the following script command:
And with the following NYC configuration settings from package.json:
And with the following .babelrc configuration setup:
I expect all my files that match the file extensions of .jsx, .js, and .mjs within the
src/**
directory will be included in the test coverage reports.Below is what I would expect to see which I only get when I turn off babel-plugin-istanbul and let NYC instrument the files:
Observed Behavior
The coverage reports only show the files that are dependencies to the tests. Here is the output I get:
Bonus Points! Code (or Repository) that Reproduces Issue
Here is a repository I created that illustrates this problem – https://github.com/hershmire/nyc-all
Forensic Information
Operating System: the operating system you observed the issue on.
macOS High Sierra v10.13.6
Environment Information: information about your project's environment, see instructions below:
sh -c 'node --version; npm --version; npm ls' > output.txt
https://github.com/hershmire/nyc-all/blob/master/output.txt
The text was updated successfully, but these errors were encountered: