This repository has been archived by the owner on Nov 30, 2024. It is now read-only.
forked from istanbuljs/nyc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make
__coverage__
the default approach we advocate for ES2015…
… coverage (istanbuljs#268) * feat: make nyc behave better when used with babel-plugin-__coverage__ (see istanbuljs#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
- Loading branch information
Showing
12 changed files
with
213 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var fs = require('fs') | ||
var path = require('path') | ||
|
||
function InstrumenterIstanbul (cwd) { | ||
var configFile = path.resolve(cwd, './.istanbul.yml') | ||
|
||
if (!fs.existsSync(configFile)) configFile = undefined | ||
var istanbul = InstrumenterIstanbul.istanbul() | ||
var instrumenterConfig = istanbul.config.loadFile(configFile).instrumentation.config | ||
|
||
return new istanbul.Instrumenter({ | ||
coverageVariable: '__coverage__', | ||
embedSource: instrumenterConfig['embed-source'], | ||
noCompact: !instrumenterConfig.compact, | ||
preserveComments: instrumenterConfig['preserve-comments'] | ||
}) | ||
} | ||
|
||
InstrumenterIstanbul.istanbul = function () { | ||
return InstrumenterIstanbul._istanbul || (InstrumenterIstanbul._istanbul = require('istanbul')) | ||
} | ||
|
||
module.exports = InstrumenterIstanbul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function NOOP () { | ||
return { | ||
instrumentSync: function (code) { | ||
return code | ||
} | ||
} | ||
} | ||
|
||
module.exports = NOOP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log(JSON.stringify(process.env)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.