(argv, expectedToFail = false)
| 39 | fs.writeFileSync(reportersIndexFile, 'module.exports = { marker: 1 };'); |
| 40 | |
| 41 | function test(argv, expectedToFail = false) { |
| 42 | const child = spawnSync(process.execPath, argv, { cwd: tmpdir.path }); |
| 43 | if (expectedToFail) { |
| 44 | assert.strictEqual(child.status, 1); |
| 45 | assert.strictEqual(child.stdout.toString().trim(), ''); |
| 46 | } else { |
| 47 | assert.strictEqual(child.status, 0); |
| 48 | assert.strictEqual(child.stdout.toString().trim(), '{ marker: 1 }'); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | test(['-e', 'console.log(require("test"))']); |
| 53 | test(['-e', 'console.log(require("test/reporters"))']); |
no test coverage detected
searching dependent graphs…