Skip to content

Commit

Permalink
make the linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Apr 6, 2019
1 parent 4c27fbf commit 6fa4332
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions test/processinfo.js
@@ -1,6 +1,6 @@
const {resolve} = require('path')
const { resolve } = require('path')
const bin = resolve(__dirname, '../self-coverage/bin/nyc')
const {spawn} = require('child_process')
const { spawn } = require('child_process')
const t = require('tap')
const rimraf = require('rimraf')
const node = process.execPath
Expand All @@ -15,13 +15,13 @@ t.teardown(() => rimraf.sync(resolve(fixturesCLI, tmp)))
t.test('build some processinfo', t => {
var args = [
bin, '-t', tmp, '--build-process-tree',
node, 'selfspawn-fibonacci.js', '5',
node, 'selfspawn-fibonacci.js', '5'
]
var proc = spawn(process.execPath, args, {
cwd: fixturesCLI,
env: {
PATH: process.env.PATH,
NYC_PROCESSINFO_EXTERNAL_ID: 'blorp',
NYC_PROCESSINFO_EXTERNAL_ID: 'blorp'
}
})
// don't actually care about the output for this test, just the data
Expand All @@ -41,15 +41,17 @@ t.test('validate the created processinfo data', t => {

covs.forEach(f => {
fs.readFile(resolve(fixturesCLI, tmp, f), 'utf8', (er, covjson) => {
if (er)
if (er) {
throw er
}
const covdata = JSON.parse(covjson)
t.same(Object.keys(covdata), [resolvedJS])
// should have matching processinfo for each cov json
const procInfoFile = resolve(fixturesCLI, tmp, 'processinfo', f)
fs.readFile(procInfoFile, 'utf8', (er, procInfoJson) => {
if (er)
if (er) {
throw er
}
const procInfoData = JSON.parse(procInfoJson)
t.match(procInfoData, {
pid: Number,
Expand All @@ -58,14 +60,14 @@ t.test('validate the created processinfo data', t => {
argv: [
node,
resolvedJS,
/[1-5]/,
/[1-5]/
],
execArgv: [],
cwd: fixturesCLI,
time: Number,
root: /^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/,
coverageFilename: resolve(fixturesCLI, tmp, f),
files: [ resolvedJS ],
files: [ resolvedJS ]
})
})
})
Expand All @@ -80,14 +82,14 @@ t.test('check out the index', t => {
t.match(index, {
processes: {},
files: {
[resolvedJS]: [u, u, u, u, u, u, u, u, u ],
[resolvedJS]: [ u, u, u, u, u, u, u, u, u ]
},
externalIds: {
blorp: {
root: u,
children: [u, u, u, u, u, u, u, u ],
},
},
children: [ u, u, u, u, u, u, u, u ]
}
}
})
t.end()
})

0 comments on commit 6fa4332

Please sign in to comment.