Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
| 1 |
'use strict' |
| 2 |
|
| 3 |
const path = require('path') |
| 4 |
const { promisify } = require('util') |
| 5 |
|
| 6 |
const t = require('tap') |
| 7 |
const rimraf = promisify(require('rimraf')) |
| 8 |
|
| 9 |
const NYC = require('../self-coverage') |
| 10 |
|
| 11 |
const { parseArgv, resetState, runNYC } = require('./helpers') |
| 12 |
|
| 13 |
const fixtures = path.resolve(__dirname, './fixtures') |
| 14 |
|
| 15 |
t.beforeEach(resetState) |
| 16 |
|
| 17 |
async function cacheTest (t, script) { |
| 18 |
const nyc = new NYC(await parseArgv(fixtures)) |
| 19 |
await rimraf(nyc.cacheDirectory) |
| 20 |
|
| 21 |
const { status } = await runNYC({ |
| 22 |
args: [ |
| 23 |
process.execPath, |
| 24 |
script |
| 25 |
], |
| 26 |
cwd: fixtures, |
| 27 |
env: {} |
| 28 |
}) |
| 29 |
|
| 30 |
t.strictEqual(status, 0) |
| 31 |
} |
| 32 |
|
| 33 |
t.test('cache handles collisions', t => cacheTest(t, './cache-collision-runner.js')) |
| 34 |
|
| 35 |
t.test('cache handles identical files', t => cacheTest(t, './identical-file-runner.js')) |