-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_runner: create flag --check-coverage to enforce code coverage
- Loading branch information
1 parent
515b007
commit e5cbacf
Showing
12 changed files
with
281 additions
and
8 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
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
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,25 @@ | ||
// Flags: --expose-internals --experimental-test-coverage --check-coverage --lines=100 --branches=100 --functions=100 | ||
|
||
'use strict'; | ||
require('../../../common'); | ||
const { TestCoverage } = require('internal/test_runner/coverage'); | ||
const { test, mock } = require('node:test'); | ||
|
||
mock.method(TestCoverage.prototype, 'summary', () => { | ||
return { | ||
files: [], | ||
totals: { | ||
totalLineCount: 100, | ||
totalBranchCount: 100, | ||
totalFunctionCount: 100, | ||
coveredLineCount: 100, | ||
coveredBranchCount: 100, | ||
coveredFunctionCount: 100, | ||
coveredLinePercent: 100, | ||
coveredBranchPercent: 100, | ||
coveredFunctionPercent: 100 | ||
} | ||
} | ||
}); | ||
|
||
test('ok'); |
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,23 @@ | ||
TAP version 13 | ||
# Subtest: ok | ||
ok 1 - ok | ||
--- | ||
duration_ms: * | ||
... | ||
1..1 | ||
# tests 1 | ||
# suites 0 | ||
# pass 1 | ||
# fail 0 | ||
# cancelled 0 | ||
# skipped 0 | ||
# todo 0 | ||
# duration_ms * | ||
# start of coverage report | ||
# ----------------------------------------------------- | ||
# file | line % | branch % | funcs % | uncovered lines | ||
# ----------------------------------------------------- | ||
# ----------------------------------------------------- | ||
# all… | 100.00 | 100.00 | 100.00 | | ||
# ----------------------------------------------------- | ||
# end of coverage report |
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,25 @@ | ||
// Flags: --expose-internals --experimental-test-coverage --check-coverage --lines=100 --branches=100 --functions=100 | ||
|
||
'use strict'; | ||
require('../../../common'); | ||
const { TestCoverage } = require('internal/test_runner/coverage'); | ||
const { test, mock } = require('node:test'); | ||
|
||
mock.method(TestCoverage.prototype, 'summary', () => { | ||
return { | ||
files: [], | ||
totals: { | ||
totalLineCount: 0, | ||
totalBranchCount: 0, | ||
totalFunctionCount: 0, | ||
coveredLineCount: 0, | ||
coveredBranchCount: 0, | ||
coveredFunctionCount: 0, | ||
coveredLinePercent: 0, | ||
coveredBranchPercent: 0, | ||
coveredFunctionPercent: 0 | ||
} | ||
} | ||
}); | ||
|
||
test('ok'); |
Oops, something went wrong.