Skip to content

Commit

Permalink
feat: Drop node.js 6, upgrade dependencies (#1134)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Node.js 8 is now required to run nyc
  • Loading branch information
coreyfarrell committed Jul 12, 2019
1 parent 421c5bd commit 00c3b34
Show file tree
Hide file tree
Showing 19 changed files with 3,009 additions and 1,625 deletions.
7 changes: 7 additions & 0 deletions .taprc
@@ -0,0 +1,7 @@
{
"test-ignore": "^test/(helpers|src)/",
"coverage": false,
"jobs": 1,
"timeout": 360,
"bail": false
}
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -7,7 +7,6 @@ node_js:
- "node"
- 10
- 8
- 6
matrix:
## An ENOMEM error occurs with 10+ under Travis-CI for Windows.
## Disable until we can determine the cause.
Expand Down
7 changes: 5 additions & 2 deletions bin/wrap.js
Expand Up @@ -16,8 +16,11 @@ if (process.env.NYC_PROCESSINFO_EXTERNAL_ID) {
}

if (process.env.NYC_CONFIG_OVERRIDE) {
var override = JSON.parse(process.env.NYC_CONFIG_OVERRIDE)
config = Object.assign(config, override)
const override = JSON.parse(process.env.NYC_CONFIG_OVERRIDE)
config = {
...config,
...override
}
process.env.NYC_CONFIG = JSON.stringify(config)
}

Expand Down
16 changes: 7 additions & 9 deletions index.js
Expand Up @@ -393,20 +393,18 @@ class NYC {
}

report () {
var tree
var map = this.getCoverageMapFromAllCoverageFiles()
var context = libReport.createContext({
const context = libReport.createContext({
dir: this.reportDirectory(),
watermarks: this.config.watermarks
watermarks: this.config.watermarks,
coverageMap: this.getCoverageMapFromAllCoverageFiles()
})

tree = libReport.summarizers.pkg(map)

this.reporter.forEach((_reporter) => {
tree.visit(reports.create(_reporter, {
reports.create(_reporter, {
skipEmpty: this.config.skipEmpty,
skipFull: this.config.skipFull
}), context)
skipFull: this.config.skipFull,
maxCols: process.stdout.columns || 100
}).execute(context)
})

if (this._showProcessTree) {
Expand Down
7 changes: 4 additions & 3 deletions lib/instrumenters/istanbul.js
Expand Up @@ -8,16 +8,17 @@ function InstrumenterIstanbul (options) {
const { plugins } = options
const configPlugins = plugins ? { plugins } : {}

const instrumenter = createInstrumenter(Object.assign({
const instrumenter = createInstrumenter({
autoWrap: true,
coverageVariable: '__coverage__',
embedSource: true,
compact: options.compact,
preserveComments: options.preserveComments,
produceSourceMap: options.produceSourceMap,
ignoreClassMethods: options.ignoreClassMethods,
esModules: options.esModules
}, configPlugins))
esModules: options.esModules,
...configPlugins
})

return {
instrumentSync (code, filename, sourceMap) {
Expand Down

0 comments on commit 00c3b34

Please sign in to comment.