import/export statements are ignored
See original GitHub issueIs it unexpected that this plugin appears to be ignoring import
and export
statements (in terms of statement and line counts)?
Maybe I have a config issue, but when I just use babel transpilation and the traditional instrumentation (left), it counts the import
lines, but when I use this plugin (right), it doesn’t count them.
The nyc
config in my package.json
:
"nyc": {
"all": true,
"checkCoverage": true,
"perFile": true,
"lines": 80,
"reporter": [
"text",
"html"
],
"include": [
"server"
],
"exclude": [
"server/data/relayNode.js",
"server/data/schema/",
"server/data/mutations/",
"server/data/generated/",
"server/data/types/",
"server/api/index.js",
"server/data/models/index.js",
"server/data/models/analytics/index.js",
"server/data/events/cli.js",
"server/lib/tomnodgbdx/scripts/workflowCli.js"
],
"require": [
"babel-register"
],
"sourceMap": false,
"instrument": false
}
My .babelrc
:
{
"sourceMaps": "inline",
"presets": [
"es2015-node",
"stage-0"
],
"plugins": [
"transform-es2015-parameters",
"transform-es2015-destructuring"
],
"env": {
"coverage": {
"plugins": [
"istanbul"
]
}
}
}
My relevant package.json
scripts
entries:
"unit": "BLUEBIRD_DEBUG=1 CONFIG=unit,unit2 mocha --recursive --require longjohn --require babel-register --require babel-polyfill tests/unit",
"coverage": "NODE_ENV=coverage nyc npm run unit",
Relevant package versions:
"babel-cli": "6.22.2",
"babel-core": "6.22.1",
"babel-eslint": "7.1.1",
"babel-plugin-transform-es2015-destructuring": "6.22.0",
"babel-plugin-transform-es2015-parameters": "6.22.0",
"babel-polyfill": "6.22.0",
"babel-preset-es2015-node": "6.1.1",
"babel-preset-stage-0": "6.22.0",
"babel-register": "6.22.0",
"babel-plugin-istanbul": "4.1.5",
"mocha": "3.2.0",
"nyc": "11.2.1",
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Why is import/export statement not working? - Stack Overflow
The way you are importing works only with default export/import. So there are two ways you can fix your code: changing the import...
Read more >what is ignore=y in import n export - Oracle Communities
If you specify IGNORE=y, Import overlooks object creation errors when it attempts to create database objects, and continues without reporting ...
Read more >Import Sets: How to check ignored records? - ServiceNow
So that accounts for 2 rows out of the 3 ignored. The next best thing I guess would be to look at the...
Read more >Export and Import - The Modern JavaScript Tutorial
js' re-exports only named exports, but ignores the default one. If we'd like to re-export both named and default exports, then two statements...
Read more >API - esbuild
Ignore annotations; JSX; JSX dev; JSX factory; JSX fragment; JSX import source; JSX side effects; Keep names; Legal comments; Log level; Log ...
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
We do have the same issue. That is very strange. Is there a way to also ignore the import statements in jest?
@VickyKoblinski I have the same issue, did you progress on it?