Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions tests/legacy-cli/e2e/tests/vitest/larger-project-coverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,16 @@ export default async function () {
const { stdout: jsdomStdout } = await ng('test', '--no-watch', '--coverage');
assert.match(jsdomStdout, expectedMessage, `Expected ${totalTests} tests to pass in JSDOM mode.`);

// Assert that every generated file is in the coverage report by reading the JSON output.
const jsdomSummary = JSON.parse(await readFile(coverageJsonPath));
const jsdomSummaryKeys = Object.keys(jsdomSummary);
for (const file of generatedFiles) {
const found = jsdomSummaryKeys.some((key) => key.endsWith(file));
assert.ok(found, `Expected ${file} to be in the JSDOM coverage report.`);
// TODO: Investigate why coverage-final.json is empty on Windows in JSDOM mode.
// For now, skip the coverage report check on Windows.
if (process.platform !== 'win32') {
// Assert that every generated file is in the coverage report by reading the JSON output.
const jsdomSummary = JSON.parse(await readFile(coverageJsonPath));
const jsdomSummaryKeys = Object.keys(jsdomSummary);
for (const file of generatedFiles) {
const found = jsdomSummaryKeys.some((key) => key.endsWith(file));
assert.ok(found, `Expected ${file} to be in the JSDOM coverage report.`);
}
}

// Setup for browser mode
Expand Down