All files are showing Unknown with plugin.
See original GitHub issueAlso posted on StackOverflow
I’m trying to get nyc
ava
and babel
to all place nice together.
I’ve done this a bunch of times, I’m not sure what’s going wrong now.
I was having an issue where async / await branches were showing as not covered, so this was working, I’m having trouble integrating the babel-plugin-istanbul
plugin for tests.
I have two files in the project, src/index.js
and src/test.js
.
{
"name": "example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "ava",
"coverage": "NODE_ENV=test nyc npm run test",
"report": "nyc report --reporter=html",
"report:open": "open ./coverage/index.html",
"cover": "npm run coverage && npm run report && npm run report:open"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"babel-runtime": "^6.26.0",
"bluebird": "^3.5.0",
"lodash": "^4.17.4"
},
"devDependencies": {
"ava": "^0.22.0",
"babel-cli": "^6.26.0",
"babel-plugin-istanbul": "^4.1.4",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.0",
"babel-register": "^6.26.0",
"nyc": "^11.2.1",
"sinon": "^3.2.1",
"testdouble": "^3.2.4"
},
"babel": {
"presets": ["env"],
"plugins": ["transform-runtime"],
"env": {
"test": {
"plugins": ["istanbul"]
}
}
},
"ava": {
"require": ["babel-register"],
"babel": "inherit"
},
"nyc": {
"sourceMap": false,
"instrument": false
}
}
Here’s whats running:
> example@1.0.0 coverage /Users/me/Desktop/example
> NODE_ENV=test nyc npm run test
> example@1.0.0 test /Users/me/Desktop/example
> ava
11 passed
----------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
All files | Unknown | Unknown | Unknown | Unknown | |
----------|----------|----------|----------|----------|----------------|
> example@1.0.0 report /Users/me/Desktop/example
> nyc report --reporter=html
> example@1.0.0 report:open /Users/em/Desktop/example
> open ./coverage/index.html
Why isn’t src/index.js
showing in the coverage?
Issue Analytics
- State:
- Created 6 years ago
- Comments:14
Top Results From Across the Web
Dealing With Unknown File Type | Tech Tip Tuesday! - YouTube
How do you deal with unknown file types within Windows 10. Chapters0:00 Introduction0:16 Windows 10 Version0:26 Folder on Desktop0:33 ...
Read more >How to open an unknown file in Windows - Digital Citizen
Simply search using the file extension first and then add terms like “file type” or “file extension,” similar to the screenshot above.
Read more >Unknown file in WordPress core
My webhost just fixed an issue with my website and now I have 454 results showing (99% are Unknown file in WordPress core)....
Read more >How to Read Unknown File Extensions
1. Right-click the file with the unknown extension and select "Scan with..." to first determine that it contains no viruses. · 2. Double-click...
Read more >How to setup a specific application to open all files with ...
Here I'll show you, how to create a item menu in the right click context menu, ... Now, if you need open a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have same problem in nyc@11.2.1 version.
Still having this issue months after I created this ticket, and I just dug deeper into the issue, here are my findings.
I was receiving this issue in my HTML output for each file: https://github.com/istanbuljs/nyc/issues/239
And I was also receiving this in the newer version of
nyc
+babel-plugin-istanbul
.I just learned several things the main one for now that I have confirmed is that:
It seems I can get it working consistently by making this simple tweak to my settings.
This is what I am using, and it’s working properly.