Skip to content

Commit

Permalink
chore: rebase cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
geeksilva97 committed Oct 5, 2024
1 parent 5a98f1c commit b208245
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions test/parallel/test-runner-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,51 +289,6 @@ test('coverage reports on lines, functions, and branches', skipIfNoInspector, as
});
});

test('coverage with source maps', skipIfNoInspector, () => {
let report = [
'# start of coverage report',
'# --------------------------------------------------------------',
'# file | line % | branch % | funcs % | uncovered lines',
'# --------------------------------------------------------------',
'# a.test.ts | 53.85 | 100.00 | 100.00 | 8-13', // part of a bundle
'# b.test.ts | 55.56 | 100.00 | 100.00 | 1 7-9', // part of a bundle
'# index.test.js | 71.43 | 66.67 | 100.00 | 6-7', // no source map
'# stdin.test.ts | 57.14 | 100.00 | 100.00 | 4-6', // Source map without original file
'# --------------------------------------------------------------',
'# all files | 58.33 | 87.50 | 100.00 | ',
'# --------------------------------------------------------------',
'# end of coverage report',
].join('\n');

if (common.isWindows) {
report = report.replaceAll('/', '\\');
}

const fixture = fixtures.path('test-runner', 'coverage');
const args = [
'--test', '--experimental-test-coverage', '--test-reporter', 'tap',
];
const result = spawnSync(process.execPath, args, { cwd: fixture });

assert.strictEqual(result.stderr.toString(), '');
assert(result.stdout.toString().includes(report));
assert.strictEqual(result.status, 1);
});

test('coverage with source maps missing sources', skipIfNoInspector, () => {
const file = fixtures.path('test-runner', 'source-map-missing-sources', 'index.js');
const missing = fixtures.path('test-runner', 'source-map-missing-sources', 'nonexistent.js');
const result = spawnSync(process.execPath, [
'--test',
'--experimental-test-coverage',
file,
]);

const error = `Cannot find '${pathToFileURL(missing)}' imported from the source map for '${pathToFileURL(file)}'`;
assert(result.stdout.toString().includes(error));
assert.strictEqual(result.status, 1);
});

test('coverage with ESM hook - source irrelevant', skipIfNoInspector, () => {
let report = [
'# start of coverage report',
Expand Down

0 comments on commit b208245

Please sign in to comment.