You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: make __coverage__ the default approach we advocate for ES2015 coverage (#268)
* feat: make nyc behave better when used with babel-plugin-__coverage__ (see #266)
* feat: abstract test include/exclude logic into its own module
* fix: add text-exclude dependency
* fix: should have instrumenters in files list
* fix: fix remapping issue with source-maps
* fix: typo was causing argument not to propagate
* docs: add section introducing __coverage__ for ES6/ES7
* docs: a couple small edits
Copy file name to clipboardexpand all lines: README.md
+36-2
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,42 @@ of the pre-transpiled code. You'll have to configure your custom require hook
60
60
to inline the source map in the transpiled code. For Babel that means setting
61
61
the `sourceMaps` option to `inline`.
62
62
63
+
## Use babel-plugin__coverage__ for Better ES6/ES7 Support
64
+
65
+
[`babel-plugin-__coverage__`](https://github.com/dtinth/babel-plugin-__coverage__) can be used to enable better first-class ES6 support.
66
+
67
+
1. enable the `__coverage__` plugin:
68
+
69
+
```json
70
+
{
71
+
"babel": {
72
+
"presets": ["es2015"],
73
+
"plugins": ["__coverage__"]
74
+
}
75
+
}
76
+
```
77
+
78
+
2. disable nyc's instrumentation and source-maps:
79
+
80
+
```json
81
+
{
82
+
"nyc": {
83
+
"include": [
84
+
"src/*.js"
85
+
],
86
+
"require": [
87
+
"babel-register"
88
+
],
89
+
"sourceMap": false,
90
+
"instrumenter": "./lib/instrumenters/noop"
91
+
}
92
+
}
93
+
```
94
+
95
+
That's all there is to it, better ES6 syntax highlighting awaits:
96
+
97
+
<imgwidth="500"src="screen2.png">
98
+
63
99
## Support For Custom File Extensions (.jsx, .es6)
64
100
65
101
Supporting file extensions can be configured through either the configuration arguments or with the `nyc` config section in `package.json`.
@@ -249,8 +285,6 @@ That's all there is to it!
249
285
[codecov](https://codecov.io/) is a great tool for adding
250
286
coverage reports to your GitHub project, even viewing them inline on GitHub with a browser extension:
0 commit comments