diff --git a/test/processinfo.js b/test/processinfo.js index f3a7b151f..7117beea6 100644 --- a/test/processinfo.js +++ b/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 @@ -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 @@ -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, @@ -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 ] }) }) }) @@ -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() })