-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_runner: fix typescript coverage
PR-URL: #49406 Fixes: #49398 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
- Loading branch information
Showing
5 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Flags: --expose-internals --experimental-test-coverage | ||
|
||
'use strict'; | ||
require('../../../common'); | ||
const { TestCoverage } = require('internal/test_runner/coverage'); | ||
const { test, mock } = require('node:test'); | ||
|
||
mock.method(TestCoverage.prototype, 'summary', () => { | ||
throw new Error('Failed to collect coverage'); | ||
}); | ||
|
||
test('ok'); | ||
|
16 changes: 16 additions & 0 deletions
16
test/fixtures/test-runner/output/coverage_failure.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
TAP version 13 | ||
# Subtest: ok | ||
ok 1 - ok | ||
--- | ||
duration_ms: * | ||
... | ||
1..1 | ||
# Warning: Could not report code coverage. Error: Failed to collect coverage | ||
# tests 1 | ||
# suites 0 | ||
# pass 1 | ||
# fail 0 | ||
# cancelled 0 | ||
# skipped 0 | ||
# todo 0 | ||
# duration_ms * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters