-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Honor eager setting (false by default) (#1179)
This delays loading of istanbul-lib-instrument until it is needed.
- Loading branch information
1 parent
0fc93d9
commit c18fb0a
Showing
5 changed files
with
59 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* IMPORTANT | ||
* This snapshot file is auto-generated, but designed for humans. | ||
* It should be checked into source control and tracked carefully. | ||
* Re-generate by setting TAP_SNAPSHOT=1 and running tests. | ||
* Make sure to inspect the output below. Do not ignore changes! | ||
*/ | ||
'use strict' | ||
exports[`test/eager.js TAP eager disabled by default > stdout 1`] = ` | ||
0 | ||
` | ||
|
||
exports[`test/eager.js TAP eager enabled > stdout 1`] = ` | ||
1 | ||
` |
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,30 @@ | ||
'use strict' | ||
|
||
const path = require('path') | ||
|
||
const t = require('tap') | ||
|
||
const { testSuccess } = require('./helpers') | ||
|
||
const cwd = path.resolve(__dirname, 'fixtures') | ||
|
||
t.test('eager disabled by default', t => testSuccess(t, { | ||
args: [ | ||
'--silent=true', | ||
'--exclude=eager.js', | ||
process.execPath, | ||
'./eager.js' | ||
], | ||
cwd | ||
})) | ||
|
||
t.test('eager enabled', t => testSuccess(t, { | ||
args: [ | ||
'--silent=true', | ||
'--eager=true', | ||
'--exclude=eager.js', | ||
process.execPath, | ||
'./eager.js' | ||
], | ||
cwd | ||
})) |
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,5 @@ | ||
#!/usr/bin/env node | ||
'use strict' | ||
|
||
const lib = require.resolve('istanbul-lib-instrument') | ||
console.log(Object.keys(require.cache).filter(s => s === lib).length) |