Skip to content

Commit 9ef340e

Browse files
authoredApr 10, 2024··
build: move tests over to latest tapjs (#1552)
build: move tests over to latest tapjs build: switch CI/CD to actions build!: minimum Node version now 18
1 parent ab7c53b commit 9ef340e

31 files changed

+12256
-297
lines changed
 

‎.github/workflows/ci.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
types: [assigned, opened, synchronize, reopened, labeled]
7+
workflow_dispatch:
8+
name: ci
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
node: [18, 20]
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node }}
21+
cache: npm
22+
- run: npm i npm@latest -g
23+
- run: npm ci --engine-strict
24+
- run: npm test
25+
windows:
26+
runs-on: windows-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: lts/*
32+
cache: npm
33+
- run: npm i npm@latest -g
34+
- run: npm ci
35+
- run: npm test

‎.github/workflows/release-please.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
name: release-please
6+
jobs:
7+
release-please:
8+
runs-on: ubuntu-latest
9+
if: github.repository == 'istanbuljs/nyc'
10+
steps:
11+
- uses: google-github-actions/release-please-action@v4
12+
id: release
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
release-type: node
16+
# The logic below handles the npm publication:
17+
- uses: actions/checkout@v3
18+
# these if statements ensure that a publication only occurs when
19+
# a new release is created:
20+
if: ${{ steps.release.outputs.release_created }}
21+
- uses: actions/setup-node@v3
22+
with:
23+
node-version: 16
24+
registry-url: 'https://external-dot-oss-automation.appspot.com'
25+
cache: npm
26+
if: ${{ steps.release.outputs.release_created }}
27+
- run: npm publish
28+
env:
29+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
30+
if: ${{ steps.release.outputs.release_created }}

‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ node_modules
44
test/build/
55
.self_coverage
66
self-coverage/
7+
.tap
78
*.swp
9+
test/fixtures/cli/coverage.json
810
needs-transpile.js

‎.npmrc

-1
This file was deleted.

‎.release-please-manifest.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "15.1.0"
3+
}

‎.taprc

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
2-
"test-ignore": "^test/(helpers|src)/",
3-
"coverage": false,
2+
"exclude": ["^test/(helpers|src|fixtures)/", "**/fixtures/**"],
3+
"disable-coverage": true,
44
"jobs": 1,
55
"timeout": 360,
66
"bail": false,
7-
"esm": false,
87
"node-arg": [
98
"--require",
109
"./self-coverage-helper.js"

‎appveyor.yml

-31
This file was deleted.

‎package-lock.json

+11,912
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@
9292
"source-map-support": "^0.5.16",
9393
"standard": "^14.3.1",
9494
"standard-version": "^9.0.0",
95-
"tap": "^14.10.5",
95+
"tap": "^18.7.2",
9696
"uuid": "^3.4.0",
9797
"which": "^2.0.2"
9898
},
9999
"engines": {
100-
"node": ">=8.9"
100+
"node": ">=18"
101101
},
102102
"homepage": "https://istanbul.js.org/",
103103
"bugs": "https://github.com/istanbuljs/nyc/issues",

‎release-please-config.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "node",
4+
"bootstrap-sha": "ab7c53b2f340b458789a746dff2abd3e2e4790c3",
5+
"packages": {
6+
".": {}
7+
}
8+
}
9+

‎tap-snapshots/test-config-override.js-TAP.test.js ‎tap-snapshots/test/config-override.js.test.cjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
* Make sure to inspect the output below. Do not ignore changes!
66
*/
77
'use strict'
8-
exports[`test/config-override.js TAP spawn that does config overriding > stdout 1`] = `
8+
exports[`test/config-override.js > TAP > spawn that does config overriding > stdout 1`] = `
99
in parent { include: 'conf-override-root.js' }
1010
in child { include: 'conf-override-module.js' }
1111
in module { include: 'conf-override-module.js' }
1212
-------------------------|---------|----------|---------|---------|-------------------
1313
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
1414
-------------------------|---------|----------|---------|---------|-------------------
15-
All files | 77.78 | 50 | 100 | 77.78 |
15+
All files | 77.77 | 50 | 100 | 77.77 |
1616
conf-override-module.js | 100 | 100 | 100 | 100 |
17-
conf-override-root.js | 71.43 | 50 | 100 | 71.43 | 22-23
17+
conf-override-root.js | 71.42 | 50 | 100 | 71.42 | 22-23
1818
-------------------------|---------|----------|---------|---------|-------------------
1919
2020
`

‎tap-snapshots/test-eager.js-TAP.test.js ‎tap-snapshots/test/eager.js.test.cjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
* Make sure to inspect the output below. Do not ignore changes!
66
*/
77
'use strict'
8-
exports[`test/eager.js TAP eager disabled by default > stdout 1`] = `
8+
exports[`test/eager.js > TAP > eager disabled by default > stdout 1`] = `
99
0
1010
1111
`
1212

13-
exports[`test/eager.js TAP eager enabled > stdout 1`] = `
13+
exports[`test/eager.js > TAP > eager enabled > stdout 1`] = `
1414
1
1515
1616
`

‎tap-snapshots/test-instrument.js-TAP.test.js ‎tap-snapshots/test/instrument.js.test.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Make sure to inspect the output below. Do not ignore changes!
66
*/
77
'use strict'
8-
exports[`test/instrument.js TAP can write files in place with --in-place switch > stdout 1`] = `
8+
exports[`test/instrument.js > TAP > can write files in place with --in-place switch > stdout 1`] = `
99
----------|---------|----------|---------|---------|-------------------
1010
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
1111
----------|---------|----------|---------|---------|-------------------

‎tap-snapshots/test-nyc-integration.js-TAP.test.js ‎tap-snapshots/test/nyc-integration.js.test.cjs

+80-80
Large diffs are not rendered by default.

‎tap-snapshots/test-tsc.js-TAP.test.js ‎tap-snapshots/test/tsc.js.test.cjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
* Make sure to inspect the output below. Do not ignore changes!
66
*/
77
'use strict'
8-
exports[`test/tsc.js TAP ignore source-map > stdout 1`] = `
8+
exports[`test/tsc.js > TAP > ignore source-map > stdout 1`] = `
99
------------|---------|----------|---------|---------|-------------------
1010
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
1111
------------|---------|----------|---------|---------|-------------------
12-
All files | 38.46 | 57.14 | 66.67 | 50 |
13-
mapping.js | 38.46 | 57.14 | 66.67 | 50 | 3-8
12+
All files | 38.46 | 57.14 | 66.66 | 50 |
13+
mapping.js | 38.46 | 57.14 | 66.66 | 50 | 3-8
1414
------------|---------|----------|---------|---------|-------------------
1515
1616
`
1717

18-
exports[`test/tsc.js TAP reads source-map > stdout 1`] = `
18+
exports[`test/tsc.js > TAP > reads source-map > stdout 1`] = `
1919
------------|---------|----------|---------|---------|-------------------
2020
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
2121
------------|---------|----------|---------|---------|-------------------

‎test/add-all-files.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ t.test('outputs an empty coverage report for all files that are not excluded', a
2424
const reports = (await nyc.coverageData()).filter(report => ap(report)[notLoadedPath])
2525
const report = reports[0][notLoadedPath]
2626

27-
t.strictEqual(reports.length, 1)
28-
t.strictEqual(report.s['0'], 0)
29-
t.strictEqual(report.s['1'], 0)
27+
t.equal(reports.length, 1)
28+
t.equal(report.s['0'], 0)
29+
t.equal(report.s['1'], 0)
3030
})
3131

3232
t.test('outputs an empty coverage report for multiple configured extensions', async t => {
@@ -42,15 +42,15 @@ t.test('outputs an empty coverage report for multiple configured extensions', as
4242
return apr[notLoadedPath1] || apr[notLoadedPath2]
4343
})
4444

45-
t.strictEqual(reports.length, 1)
45+
t.equal(reports.length, 1)
4646

4747
const report1 = reports[0][notLoadedPath1]
48-
t.strictEqual(report1.s['0'], 0)
49-
t.strictEqual(report1.s['1'], 0)
48+
t.equal(report1.s['0'], 0)
49+
t.equal(report1.s['1'], 0)
5050

5151
const report2 = reports[0][notLoadedPath2]
52-
t.strictEqual(report2.s['0'], 0)
53-
t.strictEqual(report2.s['1'], 0)
52+
t.equal(report2.s['0'], 0)
53+
t.equal(report2.s['1'], 0)
5454
})
5555

5656
t.test('transpiles .js files added via addAllFiles', async t => {
@@ -72,8 +72,8 @@ t.test('transpiles .js files added via addAllFiles', async t => {
7272
const reports = (await nyc.coverageData()).filter(report => ap(report)[needsTranspilePath])
7373
const report = reports[0][needsTranspilePath]
7474

75-
t.strictEqual(reports.length, 1)
76-
t.strictEqual(report.s['0'], 0)
75+
t.equal(reports.length, 1)
76+
t.equal(report.s['0'], 0)
7777

7878
await fs.unlink(needsTranspilePath)
7979
})
@@ -120,8 +120,8 @@ t.test('transpiles non-.js files added via addAllFiles', async t => {
120120
const reports = (await nyc.coverageData()).filter(report => ap(report)[needsTranspilePath])
121121
const report = reports[0][needsTranspilePath]
122122

123-
t.strictEqual(reports.length, 1)
124-
t.strictEqual(report.s['0'], 0)
123+
t.equal(reports.length, 1)
124+
t.equal(report.s['0'], 0)
125125

126126
await fs.unlink(needsTranspilePath)
127127
})

‎test/cache.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function cacheTest (t, script) {
2727
env: {}
2828
})
2929

30-
t.strictEqual(status, 0)
30+
t.equal(status, 0)
3131
}
3232

3333
t.test('cache handles collisions', t => cacheTest(t, './cache-collision-runner.js'))

‎test/config.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,52 @@ const { parseArgv } = require('./helpers')
1111
test("loads 'exclude' patterns from package.json#nyc", async t => {
1212
const nyc = new NYC(await parseArgv(path.resolve(__dirname, './fixtures')))
1313

14-
t.strictEqual(nyc.exclude.exclude.length, 8)
14+
t.equal(nyc.exclude.exclude.length, 8)
1515
})
1616

1717
test("loads 'extension' patterns from package.json#nyc", async t => {
1818
const nyc = new NYC(await parseArgv(path.resolve(__dirname, './fixtures/conf-multiple-extensions')))
1919

20-
t.strictEqual(nyc.extensions.length, 3)
20+
t.equal(nyc.extensions.length, 3)
2121
})
2222

2323
test("ignores 'include' option if it's falsy or []", async t => {
2424
const nyc1 = new NYC(await parseArgv(path.resolve(__dirname, './fixtures/conf-empty')))
2525

26-
t.strictEqual(nyc1.exclude.include, false)
26+
t.equal(nyc1.exclude.include, false)
2727

2828
const nyc2 = new NYC({
2929
include: []
3030
})
3131

32-
t.strictEqual(nyc2.exclude.include, false)
32+
t.equal(nyc2.exclude.include, false)
3333
})
3434

3535
test("ignores 'exclude' option if it's falsy", async t => {
3636
const nyc = new NYC(await parseArgv(path.resolve(__dirname, './fixtures/conf-empty')))
3737

38-
t.strictEqual(nyc.exclude.exclude.length, 27)
38+
t.equal(nyc.exclude.exclude.length, 27)
3939
})
4040

4141
test("allows for empty 'exclude'", async t => {
4242
const nyc = new NYC({ exclude: [] })
4343

4444
// an empty exclude still has **/node_modules/**, node_modules/** and added.
45-
t.strictEqual(nyc.exclude.exclude.length, 2)
45+
t.equal(nyc.exclude.exclude.length, 2)
4646
})
4747

4848
test("allows for completely empty 'exclude' with exclude-node-modules", async t => {
4949
const nyc = new NYC({ exclude: [], excludeNodeModules: false })
5050

51-
t.strictEqual(nyc.exclude.exclude.length, 0)
51+
t.equal(nyc.exclude.exclude.length, 0)
5252
})
5353

5454
test('should resolve default cache folder to absolute path', async t => {
5555
const nyc = new NYC({
5656
cache: true
5757
})
5858

59-
t.strictEqual(path.isAbsolute(nyc.cacheDirectory), true)
59+
t.equal(path.isAbsolute(nyc.cacheDirectory), true)
6060
})
6161

6262
test('should resolve custom cache folder to absolute path', async t => {
@@ -65,21 +65,21 @@ test('should resolve custom cache folder to absolute path', async t => {
6565
cache: true
6666
})
6767

68-
t.strictEqual(path.isAbsolute(nyc.cacheDirectory), true)
68+
t.equal(path.isAbsolute(nyc.cacheDirectory), true)
6969
})
7070

7171
test('if cache is false _disableCachingTransform is true', async t => {
7272
const nycParent = new NYC({ cache: false, isChildProcess: false })
7373
const nycChild = new NYC({ cache: false, isChildProcess: true })
7474

75-
t.strictEqual(nycParent._disableCachingTransform(), true)
76-
t.strictEqual(nycChild._disableCachingTransform(), true)
75+
t.equal(nycParent._disableCachingTransform(), true)
76+
t.equal(nycChild._disableCachingTransform(), true)
7777
})
7878

7979
test('if cache is true _disableCachingTransform is equal to !isChildProcess', async t => {
8080
const nycParent = new NYC({ cache: true, isChildProcess: false })
8181
const nycChild = new NYC({ cache: true, isChildProcess: true })
8282

83-
t.strictEqual(nycParent._disableCachingTransform(), true)
84-
t.strictEqual(nycChild._disableCachingTransform(), false)
83+
t.equal(nycParent._disableCachingTransform(), true)
84+
t.equal(nycChild._disableCachingTransform(), false)
8585
})

‎test/cwd.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ t.beforeEach(async () => {
1515
t.test('sets cwd to process.cwd() if no environment variable is set', async t => {
1616
const nyc = new NYC(await parseArgv())
1717

18-
t.strictEqual(nyc.cwd, process.cwd())
18+
t.equal(nyc.cwd, process.cwd())
1919
})
2020

2121
t.test('uses NYC_CWD environment variable for cwd if it is set', async t => {
2222
const fixtures = path.resolve(__dirname, './fixtures')
2323
process.env.NYC_CWD = fixtures
2424
const nyc = new NYC(await parseArgv())
2525

26-
t.strictEqual(nyc.cwd, fixtures)
26+
t.equal(nyc.cwd, fixtures)
2727
})
2828

2929
t.test('will look upwards for package.json from cwd', async t => {
3030
const nyc = new NYC(await parseArgv(__dirname))
3131

32-
t.strictEqual(nyc.cwd, path.join(__dirname, '..'))
32+
t.equal(nyc.cwd, path.join(__dirname, '..'))
3333
})
3434

3535
t.test('uses --cwd for cwd if it is set (highest priority and does not look upwards for package.json) ', async t => {
3636
const nyc = new NYC(await parseArgv(__dirname, ['--cwd', __dirname]))
3737

38-
t.strictEqual(nyc.cwd, __dirname)
38+
t.equal(nyc.cwd, __dirname)
3939
})

‎test/fixtures/cache-collision-worker.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ while (diff[0] * 1e9 + diff[1] < 3e9) {
1515
}
1616

1717

18-
assert.strictEqual(require('./cache-collision-target')(message), message === 'nada' ? undefined : 'this is a ' + message)
18+
assert.equal(require('./cache-collision-target')(message), message === 'nada' ? undefined : 'this is a ' + message)
1919

20-
//assert.strictEqual(process.env.NYC_CWD, __dirname)
20+
//assert.equal(process.env.NYC_CWD, __dirname)

‎test/helpers/env-check-config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ async function envCheckConfig (t, { configArgs, checkOptions }) {
1515

1616
const config = JSON.parse(JSON.parse(stdout).NYC_CONFIG)
1717

18-
t.is(status, 0)
19-
t.is(stderr, '')
18+
t.equal(status, 0)
19+
t.equal(stderr, '')
2020
t.matchSnapshot(
2121
JSON.stringify(
2222
checkOptions.sort().map(option => [option, config[option]]),

‎test/helpers/temp-dir-setup.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ function tempDirSetup (t, testFile) {
1717

1818
// Do not use arrow function for beforeEach
1919
// or afterEach, they need this from tap.
20-
t.beforeEach(async function () {
21-
this.tempDir = await mkdtemp(tempDirBase + '/')
20+
t.beforeEach(async function (t) {
21+
t.tempDir = await mkdtemp(tempDirBase + '/')
2222
})
2323

24-
t.afterEach(function () {
25-
return rimraf(this.tempDir)
24+
t.afterEach(function (t) {
25+
return rimraf(t.tempDir)
2626
})
2727

28-
t.tearDown(() => rimraf(tempDirBase))
28+
t.teardown(() => rimraf(tempDirBase))
2929
}
3030

3131
module.exports = tempDirSetup

‎test/helpers/test-success.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ async function testSuccess (t, opts) {
1010

1111
t.equal(status, 0)
1212
t.equal(stderr, '')
13+
console.info(stdout)
1314
t.matchSnapshot(stdout, 'stdout')
1415
}
1516

‎test/instrument.js

+43-43
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ t.test('works in directories without a package.json', async t => {
3131
cwd: subdir
3232
})
3333

34-
t.strictEqual(status, 0)
34+
t.equal(status, 0)
3535
const target = path.resolve(subdir, 'output-dir', 'index.js')
3636
t.match(await fs.readFile(target, 'utf8'), /console.log\('Hello, World!'\)/)
3737
})
@@ -42,7 +42,7 @@ t.test('can be configured to exit on error', async t => {
4242
cwd: subdir
4343
})
4444

45-
t.strictEqual(status, 1)
45+
t.equal(status, 1)
4646
})
4747

4848
t.test('allows a single file to be instrumented', async t => {
@@ -57,15 +57,15 @@ t.test('allows a single file to be instrumented', async t => {
5757
args: ['instrument', './half-covered.js', outputDir]
5858
})
5959

60-
t.strictEqual(status, 0)
60+
t.equal(status, 0)
6161

6262
const files = await fs.readdir(outputDir)
6363
t.strictSame(files, ['half-covered.js'])
6464

6565
if (!isWindows) {
6666
const outputPath = path.resolve(outputDir, 'half-covered.js')
6767
const outputMode = (await fs.stat(outputPath)).mode & 0o7777
68-
t.strictEqual(outputMode, newMode)
68+
t.equal(outputMode, newMode)
6969

7070
await fs.chmod(inputPath, inputMode)
7171
}
@@ -76,13 +76,13 @@ t.test('allows a directory of files to be instrumented', async t => {
7676
args: ['instrument', './nyc-config-js', outputDir]
7777
})
7878

79-
t.strictEqual(status, 0)
79+
t.equal(status, 0)
8080

8181
const files = fs.readdirSync(outputDir)
82-
t.strictEqual(files.includes('index.js'), true)
83-
t.strictEqual(files.includes('ignore.js'), true)
84-
t.strictEqual(files.includes('package.json'), false)
85-
t.strictEqual(files.includes('node_modules'), false)
82+
t.equal(files.includes('index.js'), true)
83+
t.equal(files.includes('ignore.js'), true)
84+
t.equal(files.includes('package.json'), false)
85+
t.equal(files.includes('node_modules'), false)
8686

8787
const includeTarget = path.resolve(outputDir, 'ignore.js')
8888
t.match(await fs.readFile(includeTarget, 'utf8'), /function cov_/)
@@ -98,13 +98,13 @@ t.test('copies all files from <input> to <output> as well as those that have bee
9898
args: ['instrument', '--complete-copy', './nyc-config-js', outputDir]
9999
})
100100

101-
t.strictEqual(status, 0)
101+
t.equal(status, 0)
102102

103103
const files = await fs.readdir(outputDir)
104-
t.strictEqual(files.includes('index.js'), true)
105-
t.strictEqual(files.includes('ignore.js'), true)
106-
t.strictEqual(files.includes('package.json'), true)
107-
t.strictEqual(files.includes('node_modules'), true)
104+
t.equal(files.includes('index.js'), true)
105+
t.equal(files.includes('ignore.js'), true)
106+
t.equal(files.includes('package.json'), true)
107+
t.equal(files.includes('node_modules'), true)
108108

109109
const includeTarget = path.resolve(outputDir, 'ignore.js')
110110
t.match(await fs.readFile(includeTarget, 'utf8'), /function cov_/)
@@ -115,22 +115,22 @@ t.test('can instrument the project directory', async t => {
115115
args: ['instrument', '.', outputDir]
116116
})
117117

118-
t.strictEqual(status, 0)
118+
t.equal(status, 0)
119119

120120
const files = await fs.readdir(outputDir)
121-
t.strictEqual(files.includes('args.js'), true)
122-
t.strictEqual(files.includes('subdir'), true)
121+
t.equal(files.includes('args.js'), true)
122+
t.equal(files.includes('subdir'), true)
123123
})
124124

125125
t.test('allows a sub-directory of files to be instrumented', async t => {
126126
const { status } = await runNYC({
127127
args: ['instrument', './subdir/input-dir', outputDir]
128128
})
129129

130-
t.strictEqual(status, 0)
130+
t.equal(status, 0)
131131

132132
const files = await fs.readdir(outputDir)
133-
t.strictEqual(files.includes('index.js'), true)
133+
t.equal(files.includes('index.js'), true)
134134
})
135135

136136
t.test('allows a subdirectory to be excluded via .nycrc file', async t => {
@@ -144,13 +144,13 @@ t.test('allows a subdirectory to be excluded via .nycrc file', async t => {
144144
]
145145
})
146146

147-
t.strictEqual(status, 0)
147+
t.equal(status, 0)
148148

149149
const files = fs.readdirSync(outputDir)
150-
t.strictEqual(files.includes('exclude-me'), true)
151-
t.strictEqual(files.includes('node_modules'), true)
152-
t.strictEqual(files.includes('index.js'), true)
153-
t.strictEqual(files.includes('bad.js'), true)
150+
t.equal(files.includes('exclude-me'), true)
151+
t.equal(files.includes('node_modules'), true)
152+
t.equal(files.includes('index.js'), true)
153+
t.equal(files.includes('bad.js'), true)
154154

155155
const includeTarget = path.resolve(outputDir, 'index.js')
156156
t.match(await fs.readFile(includeTarget, 'utf8'), /function cov_/)
@@ -171,10 +171,10 @@ t.test('allows a file to be excluded', async t => {
171171
]
172172
})
173173

174-
t.strictEqual(status, 0)
174+
t.equal(status, 0)
175175

176176
const files = await fs.readdir(outputDir)
177-
t.strictEqual(files.includes('exclude-me'), true)
177+
t.equal(files.includes('exclude-me'), true)
178178

179179
const excludeTarget = path.resolve(outputDir, 'exclude-me', 'index.js')
180180
t.notMatch(await fs.readFile(excludeTarget, 'utf8'), /function cov_/)
@@ -191,10 +191,10 @@ t.test('allows specifying a single sub-directory to be included', async t => {
191191
]
192192
})
193193

194-
t.strictEqual(status, 0)
194+
t.equal(status, 0)
195195

196196
const files = await fs.readdir(outputDir)
197-
t.strictEqual(files.includes('include-me'), true)
197+
t.equal(files.includes('include-me'), true)
198198
const instrumented = path.resolve(outputDir, 'include-me', 'include-me.js')
199199
t.match(await fs.readFile(instrumented, 'utf8'), /function cov_/)
200200
})
@@ -213,14 +213,14 @@ t.test('allows a file to be excluded from an included directory', async t => {
213213
]
214214
})
215215

216-
t.strictEqual(status, 0)
216+
t.equal(status, 0)
217217

218218
const files = await fs.readdir(outputDir)
219-
t.strictEqual(files.includes('include-me'), true)
219+
t.equal(files.includes('include-me'), true)
220220

221221
const includeMeFiles = await fs.readdir(path.resolve(outputDir, 'include-me'))
222-
t.strictEqual(includeMeFiles.includes('include-me.js'), true)
223-
t.strictEqual(includeMeFiles.includes('exclude-me.js'), true)
222+
t.equal(includeMeFiles.includes('include-me.js'), true)
223+
t.equal(includeMeFiles.includes('exclude-me.js'), true)
224224

225225
const includeTarget = path.resolve(outputDir, 'include-me', 'include-me.js')
226226
t.match(await fs.readFile(includeTarget, 'utf8'), /function cov_/)
@@ -234,7 +234,7 @@ t.test('aborts if trying to write files in place', async t => {
234234
args: ['instrument', './', './']
235235
})
236236

237-
t.strictEqual(status, 1)
237+
t.equal(status, 1)
238238
t.match(stderr, /cannot instrument files in place/)
239239
})
240240

@@ -256,7 +256,7 @@ t.test('can write files in place with --in-place switch', async t => {
256256
cwd: outputDir
257257
})
258258

259-
t.strictEqual(status, 0)
259+
t.equal(status, 0)
260260

261261
const file1 = path.resolve(outputDir, 'file1.js')
262262
t.match(await fs.readFile(file1, 'utf8'), /function cov_/)
@@ -282,7 +282,7 @@ t.test('aborts if trying to delete while writing files in place', async t => {
282282
]
283283
})
284284

285-
t.strictEqual(status, 1)
285+
t.equal(status, 1)
286286
t.match(stderr, /cannot use '--delete' when instrumenting files in place/)
287287
})
288288

@@ -296,7 +296,7 @@ t.test('aborts if trying to instrument files from outside the project root direc
296296
]
297297
})
298298

299-
t.strictEqual(status, 1)
299+
t.equal(status, 1)
300300
t.match(stderr, /cannot instrument files outside project root directory/)
301301
})
302302

@@ -312,11 +312,11 @@ t.test('cleans the output directory if `--delete` is specified', async t => {
312312
]
313313
})
314314

315-
t.strictEqual(status, 0)
315+
t.equal(status, 0)
316316

317317
const files = await fs.readdir(outputDir)
318-
t.strictEqual(files.includes('removed-by-clean'), false)
319-
t.strictEqual(files.includes('exclude-me'), true)
318+
t.equal(files.includes('removed-by-clean'), false)
319+
t.equal(files.includes('exclude-me'), true)
320320
})
321321

322322
t.test('does not clean the output directory by default', async t => {
@@ -330,18 +330,18 @@ t.test('does not clean the output directory by default', async t => {
330330
]
331331
})
332332

333-
t.strictEqual(status, 0)
333+
t.equal(status, 0)
334334

335335
const files = await fs.readdir(outputDir)
336-
t.strictEqual(files.includes('removed-by-clean'), true)
336+
t.equal(files.includes('removed-by-clean'), true)
337337
})
338338

339339
t.test('aborts if trying to clean process.cwd()', async t => {
340340
const { status, stderr } = await runNYC({
341341
args: ['instrument', '--delete', './src', './']
342342
})
343343

344-
t.strictEqual(status, 1)
344+
t.equal(status, 1)
345345
t.match(stderr, /attempt to delete/)
346346
})
347347

@@ -350,6 +350,6 @@ t.test('aborts if trying to clean outside working directory', async t => {
350350
args: ['instrument', '--delete', './', '../']
351351
})
352352

353-
t.strictEqual(status, 1)
353+
t.equal(status, 1)
354354
t.match(stderr, /attempt to delete/)
355355
})

‎test/issue-190.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ async function runFakeNPM (t) {
2828
const args = [nycBin, 'npm', 'test']
2929
const { stderr, status } = await spawn(process.execPath, args, spawnOptions)
3030

31-
t.strictEqual(status, 0)
32-
t.strictEqual(stderr, '')
31+
t.equal(status, 0)
32+
t.equal(stderr, '')
3333
}
3434

3535
t.beforeEach(() => Promise.all([

‎test/nyc-integration.js

+33-33
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ t.test('does not interpret args intended for instrumented bin', async t => {
184184
args: ['--silent', process.execPath, 'args.js', '--help', '--version'],
185185
leavePathSep: true
186186
})
187-
t.is(status, 0)
188-
t.is(stderr, '')
187+
t.equal(status, 0)
188+
t.equal(stderr, '')
189189
t.matchSnapshot(JSON.parse(stdout).slice(2))
190190
})
191191

@@ -221,8 +221,8 @@ t.test('nyc instrument single file to console', async t => {
221221
args: ['instrument', './half-covered.js']
222222
})
223223

224-
t.is(status, 0)
225-
t.is(stderr, '')
224+
t.equal(status, 0)
225+
t.equal(stderr, '')
226226
t.match(originalText.stdout, `path:${JSON.stringify(path.resolve(fixturesCLI, 'half-covered.js'))}`)
227227
})
228228

@@ -232,8 +232,8 @@ t.test('nyc instrument disabled instrument', async t => {
232232
args: ['instrument', '--instrument=false', 'half-covered.js']
233233
})
234234

235-
t.is(status, 0)
236-
t.is(stderr, '')
235+
t.equal(status, 0)
236+
t.equal(stderr, '')
237237
t.match(stdout, 'var a = 0')
238238
t.notMatch(stdout, 'cov_')
239239
})
@@ -244,8 +244,8 @@ t.test('nyc instrument a directory of files', async t => {
244244
args: ['instrument', './']
245245
})
246246

247-
t.is(status, 0)
248-
t.is(stderr, '')
247+
t.equal(status, 0)
248+
t.equal(stderr, '')
249249
t.match(originalText.stdout, `path:${JSON.stringify(path.resolve(fixturesCLI, 'half-covered.js'))}`)
250250
t.match(originalText.stdout, `path:${JSON.stringify(path.resolve(fixturesCLI, 'half-covered-failing.js'))}`)
251251
t.notMatch(originalText.stdout, `path:${JSON.stringify(path.resolve(fixturesCLI, 'test.js'))}`)
@@ -257,8 +257,8 @@ t.test('nyc instrument returns unmodified source if there is no transform', asyn
257257
args: ['instrument', './no-transform/half-covered.xjs']
258258
})
259259

260-
t.is(status, 0)
261-
t.is(stderr, '')
260+
t.equal(status, 0)
261+
t.equal(stderr, '')
262262
t.match(stdout, 'var a = 0')
263263
t.notMatch(stdout, 'cov_')
264264
})
@@ -269,8 +269,8 @@ t.test('nyc instrument on file with `package` keyword when es-modules is disable
269269
args: ['instrument', '--no-es-modules', './not-strict.js']
270270
})
271271

272-
t.is(status, 0)
273-
t.is(stderr, '')
272+
t.equal(status, 0)
273+
t.equal(stderr, '')
274274
t.match(originalText.stdout, `path:${JSON.stringify(path.resolve(fixturesCLI, 'not-strict.js'))}`)
275275
})
276276

@@ -284,9 +284,9 @@ t.test('nyc displays help to stderr when it doesn\'t know what to do', async t =
284284
args: ['--help']
285285
})
286286

287-
t.is(help.status, 0)
288-
t.is(help.stderr, '')
289-
t.isNot(help.stdout, '')
287+
t.equal(help.status, 0)
288+
t.equal(help.stderr, '')
289+
t.strictNotSame(help.stdout, '')
290290

291291
const { status, stderr, stdout } = await runNYC({
292292
tempDir: t.tempDir,
@@ -358,10 +358,10 @@ t.test('extracts coverage headers from unexecuted files', async t => {
358358
}
359359
}))
360360

361-
t.true(coverage.length !== 0)
362-
t.true(coverage.every(data => typeof data === 'object'))
361+
t.ok(coverage.length !== 0)
362+
t.ok(coverage.every(data => typeof data === 'object'))
363363
// we should not have executed file, so all counts sould be 0.
364-
t.true(coverage.every(data => Object.values(data.s).every(s => s === 0)))
364+
t.ok(coverage.every(data => Object.values(data.s).every(s => s === 0)))
365365
})
366366

367367
t.test('allows an alternative cache folder to be specified', async t => {
@@ -378,7 +378,7 @@ t.test('allows an alternative cache folder to be specified', async t => {
378378

379379
// we should have created foo-cache rather
380380
// than the default ./node_modules/.cache.
381-
t.is(1, (await fs.readdir(cacheDir)).length)
381+
t.equal(1, (await fs.readdir(cacheDir)).length)
382382

383383
await rimraf(cacheDir)
384384
})
@@ -396,7 +396,7 @@ t.test('does not create .cache folder if cache is "false"', async t => {
396396
]
397397
})
398398

399-
t.false(fs.existsSync(cacheDir))
399+
t.notOk(fs.existsSync(cacheDir))
400400
})
401401

402402
t.test('allows alternative high and low watermarks to be configured', t => testSuccess(t, {
@@ -456,7 +456,7 @@ t.test('caches source-maps from .map files', async t => {
456456
})
457457

458458
const files = await fs.readdir(path.resolve(fixturesSourceMaps, 'node_modules/.cache/nyc'))
459-
t.true(files.some(f => f.startsWith('s1.min-') && f.endsWith('.map')))
459+
t.ok(files.some(f => f.startsWith('s1.min-') && f.endsWith('.map')))
460460
})
461461

462462
t.test('caches inline source-maps', async t => {
@@ -469,7 +469,7 @@ t.test('caches inline source-maps', async t => {
469469
})
470470

471471
const files = await fs.readdir(path.resolve(fixturesSourceMaps, 'node_modules/.cache/nyc'))
472-
t.true(files.some(f => f.startsWith('s2.min-') && f.endsWith('.map')))
472+
t.ok(files.some(f => f.startsWith('s2.min-') && f.endsWith('.map')))
473473
})
474474

475475
t.test('appropriately instruments file with corresponding .map file', t => testSuccess(t, {
@@ -578,8 +578,8 @@ t.test('instrument with exclude-node-modules=false', async t => {
578578
cwd: fixturesENM
579579
})
580580

581-
t.is(status, 0)
582-
t.is(stderr, '')
581+
t.equal(status, 0)
582+
t.equal(stderr, '')
583583
t.match(stdout, 'fake-module-1')
584584
})
585585

@@ -604,15 +604,15 @@ t.test('combines multiple coverage reports', async t => {
604604
const mergedCoverage = require('./fixtures/cli/coverage')
605605
// the combined reports should have 100% function
606606
// branch and statement coverage.
607-
t.strictDeepEqual(
607+
t.same(
608608
mergedCoverage['/private/tmp/contrived/library.js'].s,
609609
{ 0: 2, 1: 1, 2: 1, 3: 2, 4: 1, 5: 1 }
610610
)
611-
t.strictDeepEqual(
611+
t.same(
612612
mergedCoverage['/private/tmp/contrived/library.js'].f,
613613
{ 0: 1, 1: 1, 2: 2 }
614614
)
615-
t.strictDeepEqual(
615+
t.same(
616616
mergedCoverage['/private/tmp/contrived/library.js'].b,
617617
{ 0: [1, 1] }
618618
)
@@ -642,9 +642,9 @@ t.test('instrument with invalid --require fails when using node-preload', async
642642
]
643643
})
644644

645-
t.is(status, 1)
645+
t.equal(status, 1)
646646
t.match(stderr, /Cannot find module '@istanbuljs\/this-module-does-not-exist'/)
647-
t.is(stdout, '')
647+
t.equal(stdout, '')
648648
})
649649

650650
t.test('invalid --require fails when using node-preload', async t => {
@@ -656,9 +656,9 @@ t.test('invalid --require fails when using node-preload', async t => {
656656
]
657657
})
658658

659-
t.is(status, 1)
659+
t.equal(status, 1)
660660
t.match(stderr, /Cannot find module '@istanbuljs\/this-module-does-not-exist'/)
661-
t.is(stdout, '')
661+
t.equal(stdout, '')
662662
})
663663

664664
t.test('invalid --require fails when using spawn-wrap', async t => {
@@ -672,7 +672,7 @@ t.test('invalid --require fails when using spawn-wrap', async t => {
672672
]
673673
})
674674

675-
t.is(status, 1)
675+
t.equal(status, 1)
676676
t.match(stderr, /Cannot find module '@istanbuljs\/this-module-does-not-exist'/)
677-
t.is(stdout, '')
677+
t.equal(stdout, '')
678678
})

‎test/parser-plugins.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ t.test('parser plugin set', async t => {
1313
args: ['instrument', 'v8.js'],
1414
cwd
1515
})
16-
t.strictEqual(status, 0)
17-
t.strictEqual(stderr, '')
16+
t.equal(status, 0)
17+
t.equal(stderr, '')
1818
t.match(stdout, /function cov_/)
1919
})
2020

@@ -23,7 +23,7 @@ t.test('parser plugin unset', async t => {
2323
args: ['instrument', '--nycrc-path=no-plugins.json', 'v8.js'],
2424
cwd
2525
})
26-
t.strictEqual(status, 0)
27-
t.strictEqual(stderr, '')
26+
t.equal(status, 0)
27+
t.equal(stderr, '')
2828
t.notMatch(stdout, /function cov_/)
2929
})

‎test/report.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async function testSignal (t, signal) {
3232
const checkFile = path.join(fixtures, `${signal}.js`)
3333
const reports = (await nyc.coverageData()).filter(report => report[checkFile])
3434

35-
t.strictEqual(reports.length, 1)
35+
t.equal(reports.length, 1)
3636
}
3737

3838
t.test('writes coverage report when process is killed with SIGTERM', t => testSignal(t, 'sigterm'))
@@ -47,6 +47,6 @@ t.test('allows coverage report to be output in an alternative directory', async
4747
await nyc.reset()
4848

4949
await nyc.report()
50-
t.strictEqual(fs.existsSync('./alternative-report/lcov.info'), true)
50+
t.equal(fs.existsSync('./alternative-report/lcov.info'), true)
5151
await rimraf('./alternative-report')
5252
})

‎test/should-instrument.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,47 @@ t.test('should exclude appropriately with defaults', async t => {
1919
]))
2020

2121
// nyc always excludes "node_modules/**"
22-
t.true(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo.js'), 'foo.js'))
23-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'node_modules/bar.js'), 'node_modules/bar.js'))
24-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo/node_modules/bar.js'), 'foo/node_modules/bar.js'))
25-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'test.js'), 'test.js'))
26-
t.true(nyc.exclude.shouldInstrument(path.join(rootDir, 'testfoo.js'), 'testfoo.js'))
27-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'test-foo.js'), 'test-foo.js'))
28-
t.true(nyc.exclude.shouldInstrument(path.join(rootDir, 'lib/test.js'), 'lib/test.js'))
29-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo/bar/test.js'), './test.js'))
30-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo/bar/test.js'), '.\\test.js'))
31-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo/bar/foo.test.js'), './foo.test.js'))
32-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo/bar/__tests__/foo.js'), './__tests__/foo.js'))
22+
t.ok(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo.js'), 'foo.js'))
23+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'node_modules/bar.js'), 'node_modules/bar.js'))
24+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo/node_modules/bar.js'), 'foo/node_modules/bar.js'))
25+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'test.js'), 'test.js'))
26+
t.ok(nyc.exclude.shouldInstrument(path.join(rootDir, 'testfoo.js'), 'testfoo.js'))
27+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'test-foo.js'), 'test-foo.js'))
28+
t.ok(nyc.exclude.shouldInstrument(path.join(rootDir, 'lib/test.js'), 'lib/test.js'))
29+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo/bar/test.js'), './test.js'))
30+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo/bar/test.js'), '.\\test.js'))
31+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo/bar/foo.test.js'), './foo.test.js'))
32+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo/bar/__tests__/foo.js'), './__tests__/foo.js'))
3333
})
3434

3535
t.test('should exclude appropriately with config.exclude', async t => {
3636
const nyc = new NYC(await parseArgv(fixtures))
3737

3838
// fixtures/package.json configures excludes: "blarg", "blerg"
39-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'blarg.js'), 'blarg.js'))
40-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'blarg/foo.js'), 'blarg/foo.js'))
41-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'blerg.js'), 'blerg.js'))
42-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'blerg.js'), './blerg.js'))
43-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'blerg.js'), '.\\blerg.js'))
39+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'blarg.js'), 'blarg.js'))
40+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'blarg/foo.js'), 'blarg/foo.js'))
41+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'blerg.js'), 'blerg.js'))
42+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'blerg.js'), './blerg.js'))
43+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'blerg.js'), '.\\blerg.js'))
4444
})
4545

4646
t.test('should exclude outside of the current working directory', async t => {
4747
const nyc = new NYC(await parseArgv(path.join(rootDir, 'foo')))
48-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'bar.js'), '../bar.js'))
48+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'bar.js'), '../bar.js'))
4949
})
5050

5151
t.test('should not exclude if the current working directory is inside node_modules', async t => {
5252
const cwd = path.join(rootDir, 'node_modules', 'foo')
5353
const nyc = new NYC(await parseArgv(cwd))
54-
t.true(nyc.exclude.shouldInstrument(path.join(cwd, 'bar.js'), './bar.js'))
55-
t.true(nyc.exclude.shouldInstrument(path.join(cwd, 'bar.js'), '.\\bar.js'))
54+
t.ok(nyc.exclude.shouldInstrument(path.join(cwd, 'bar.js'), './bar.js'))
55+
t.ok(nyc.exclude.shouldInstrument(path.join(cwd, 'bar.js'), '.\\bar.js'))
5656
})
5757

5858
t.test('allows files to be explicitly included, rather than excluded', async t => {
5959
const nyc = new NYC(await parseArgv(rootDir, ['--include=foo.js']))
6060

61-
t.true(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo.js'), 'foo.js'))
62-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'index.js'), 'index.js'))
61+
t.ok(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo.js'), 'foo.js'))
62+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'index.js'), 'index.js'))
6363
})
6464

6565
t.test('exclude overrides include', async t => {
@@ -71,6 +71,6 @@ t.test('exclude overrides include', async t => {
7171
'--exclude=test{,-*}.js'
7272
]))
7373

74-
t.true(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo.js'), 'foo.js'))
75-
t.false(nyc.exclude.shouldInstrument(path.join(rootDir, 'test.js'), 'test.js'))
74+
t.ok(nyc.exclude.shouldInstrument(path.join(rootDir, 'foo.js'), 'foo.js'))
75+
t.notOk(nyc.exclude.shouldInstrument(path.join(rootDir, 'test.js'), 'test.js'))
7676
})

‎test/temp-dir.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ t.test('creates the default \'tempDir\' when none is specified', async t => {
2525
args: [process.execPath, './half-covered.js']
2626
})
2727

28-
t.strictEqual(status, 0)
28+
t.equal(status, 0)
2929

3030
const cliFiles = await fs.readdir(path.resolve(fixturesCLI))
31-
t.strictEqual(cliFiles.includes('.nyc_output'), true)
32-
t.strictEqual(cliFiles.includes('.temp_dir'), false)
33-
t.strictEqual(cliFiles.includes('.temp_directory'), false)
31+
t.equal(cliFiles.includes('.nyc_output'), true)
32+
t.equal(cliFiles.includes('.temp_dir'), false)
33+
t.equal(cliFiles.includes('.temp_directory'), false)
3434

3535
const tempFiles = await fs.readdir(path.resolve(fixturesCLI, '.nyc_output'))
36-
t.strictEqual(tempFiles.length, 2) // the coverage file, and processinfo
36+
t.equal(tempFiles.length, 2) // the coverage file, and processinfo
3737
})
3838

3939
t.test('prefers \'tempDirectory\' to \'tempDir\'', async t => {
@@ -48,15 +48,15 @@ t.test('prefers \'tempDirectory\' to \'tempDir\'', async t => {
4848
]
4949
})
5050

51-
t.strictEqual(status, 0)
51+
t.equal(status, 0)
5252

5353
const cliFiles = await fs.readdir(path.resolve(fixturesCLI))
54-
t.strictEqual(cliFiles.includes('.nyc_output'), false)
55-
t.strictEqual(cliFiles.includes('.temp_dir'), false)
56-
t.strictEqual(cliFiles.includes('.temp_directory'), true)
54+
t.equal(cliFiles.includes('.nyc_output'), false)
55+
t.equal(cliFiles.includes('.temp_dir'), false)
56+
t.equal(cliFiles.includes('.temp_directory'), true)
5757

5858
const tempFiles = await fs.readdir(path.resolve(fixturesCLI, '.temp_directory'))
59-
t.strictEqual(tempFiles.length, 2)
59+
t.equal(tempFiles.length, 2)
6060
})
6161

6262
t.test('uses the \'tempDir\' option if \'tempDirectory\' is not set', async t => {
@@ -69,13 +69,13 @@ t.test('uses the \'tempDir\' option if \'tempDirectory\' is not set', async t =>
6969
]
7070
})
7171

72-
t.strictEqual(status, 0)
72+
t.equal(status, 0)
7373

7474
const cliFiles = await fs.readdir(path.resolve(fixturesCLI))
75-
t.strictEqual(cliFiles.includes('.nyc_output'), false)
76-
t.strictEqual(cliFiles.includes('.temp_dir'), true)
77-
t.strictEqual(cliFiles.includes('.temp_directory'), false)
75+
t.equal(cliFiles.includes('.nyc_output'), false)
76+
t.equal(cliFiles.includes('.temp_dir'), true)
77+
t.equal(cliFiles.includes('.temp_directory'), false)
7878

7979
const tempFiles = await fs.readdir(path.resolve(fixturesCLI, '.temp_dir'))
80-
t.strictEqual(tempFiles.length, 2)
80+
t.equal(tempFiles.length, 2)
8181
})

‎test/wrap.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ t.test('wraps modules with coverage counters when they are required', async t =>
2323
nyc.wrap()
2424

2525
const check = require('./fixtures/check-instrumented')
26-
t.strictEqual(check(), true)
26+
t.equal(check(), true)
2727
})
2828

2929
t.test('wraps modules with coverage counters when the custom require hook compiles them', async t => {
@@ -43,8 +43,8 @@ t.test('wraps modules with coverage counters when the custom require hook compil
4343
require.extensions['.js'] = hook // eslint-disable-line
4444

4545
const check = require('./fixtures/check-instrumented')
46-
t.strictEqual(check(), true)
47-
t.strictEqual(required, true)
46+
t.equal(check(), true)
47+
t.equal(required, true)
4848
})
4949

5050
t.test('assigns a function to custom extensions', async t => {
@@ -80,8 +80,8 @@ t.test('calls the `_handleJs` function for custom file extensions', async t => {
8080

8181
require('./fixtures/conf-multiple-extensions/check-instrumented.es6')
8282
require('./fixtures/conf-multiple-extensions/check-instrumented.foo.bar')
83-
t.strictEqual(required.custom, true)
84-
t.strictEqual(required.es6, true)
83+
t.equal(required.custom, true)
84+
t.equal(required.es6, true)
8585
})
8686

8787
t.test('does not output coverage for files that have not been included, by default', async t => {
@@ -90,7 +90,7 @@ t.test('does not output coverage for files that have not been included, by defau
9090
await nyc.reset()
9191

9292
const reports = (await nyc.coverageData()).filter(report => report['./test/fixtures/not-loaded.js'])
93-
t.strictEqual(reports.length, 0)
93+
t.equal(reports.length, 0)
9494
})
9595

9696
t.test('tracks coverage appropriately once the file is required', async t => {
@@ -106,7 +106,7 @@ t.test('tracks coverage appropriately once the file is required', async t => {
106106
const reports = (await nyc.coverageData()).filter(report => report[notLoadedPath])
107107
const report = reports[0][notLoadedPath]
108108

109-
t.strictEqual(reports.length, 1)
110-
t.strictEqual(report.s['0'], 1)
111-
t.strictEqual(report.s['1'], 1)
109+
t.equal(reports.length, 1)
110+
t.equal(report.s['0'], 1)
111+
t.equal(report.s['1'], 1)
112112
})

0 commit comments

Comments
 (0)
Please sign in to comment.