| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ed07075 commit 3ccd5fa
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,7 +58,7 @@ async function * tapReporter(source) { | |||
| 58 | 58 | yield `${indent(data.nesting)}# ${tapEscape(data.message)}\n`; | |
| 59 | 59 | break; | |
| 60 | 60 | case 'test:coverage': | |
| 61 | - yield getCoverageReport(indent(data.nesting), data.summary, '# ', ''); | ||
| 61 | + yield getCoverageReport(indent(data.nesting), data.summary, '# ', '', true); | ||
| 62 | 62 | break; | |
| 63 | 63 | } | |
| 64 | 64 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,16 +22,21 @@ function findCoverageFileForPid(pid) { | |||
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | 24 | function getTapCoverageFixtureReport() { | |
| 25 | + /* eslint-disable max-len */ | ||
| 25 | 26 | const report = [ | |
| 26 | 27 | '# start of coverage report', | |
| 27 | - '# file | line % | branch % | funcs % | uncovered lines', | ||
| 28 | - '# test/fixtures/test-runner/coverage.js | 78.65 | 38.46 | 60.00 | 12, ' + | ||
| 29 | - '13, 16, 17, 18, 19, 20, 21, 22, 27, 39, 43, 44, 61, 62, 66, 67, 71, 72', | ||
| 30 | - '# test/fixtures/test-runner/invalid-tap.js | 100.00 | 100.00 | 100.00 | ', | ||
| 31 | - '# test/fixtures/v8-coverage/throw.js | 71.43 | 50.00 | 100.00 | 5, 6', | ||
| 32 | - '# all files | 78.35 | 43.75 | 60.00 |', | ||
| 28 | + '# -------------------------------------------------------------------------------------------------------------------', | ||
| 29 | + '# file | line % | branch % | funcs % | uncovered lines', | ||
| 30 | + '# -------------------------------------------------------------------------------------------------------------------', | ||
| 31 | + '# test/fixtures/test-runner/coverage.js | 78.65 | 38.46 | 60.00 | 12-13 16-22 27 39 43-44 61-62 66-67 71-72', | ||
| 32 | + '# test/fixtures/test-runner/invalid-tap.js | 100.00 | 100.00 | 100.00 | ', | ||
| 33 | + '# test/fixtures/v8-coverage/throw.js | 71.43 | 50.00 | 100.00 | 5-6', | ||
| 34 | + '# -------------------------------------------------------------------------------------------------------------------', | ||
| 35 | + '# all files | 78.35 | 43.75 | 60.00 |', | ||
| 36 | + '# -------------------------------------------------------------------------------------------------------------------', | ||
| 33 | 37 | '# end of coverage report', | |
| 34 | 38 | ].join('\n'); | |
| 39 | + /* eslint-enable max-len */ | ||
| 35 | 40 | ||
| 36 | 41 | if (common.isWindows) { | |
| 37 | 42 | return report.replaceAll('/', '\\'); | |
@@ -88,7 +93,6 @@ test('test tap coverage reporter', skipIfNoInspector, async (t) => { | |||
| 88 | 93 | const options = { env: { ...process.env, NODE_V8_COVERAGE: tmpdir.path } }; | |
| 89 | 94 | const result = spawnSync(process.execPath, args, options); | |
| 90 | 95 | const report = getTapCoverageFixtureReport(); | |
| 91 | - | ||
| 92 | 96 | assert(result.stdout.toString().includes(report)); | |
| 93 | 97 | assert.strictEqual(result.stderr.toString(), ''); | |
| 94 | 98 | assert.strictEqual(result.status, 0); | |
@@ -152,16 +156,16 @@ test('single process coverage is the same with --test', skipIfNoInspector, () => | |||
| 152 | 156 | test('coverage is combined for multiple processes', skipIfNoInspector, () => { | |
| 153 | 157 | let report = [ | |
| 154 | 158 | '# start of coverage report', | |
| 155 | - '# file | line % | branch % | funcs % | uncovered lines', | ||
| 156 | - '# common.js | 89.86 | ' + | ||
| 157 | - '62.50 | 100.00 | 8, 13, 14, 18, 34, 35, 53', | ||
| 158 | - '# first.test.js | 83.33 | ' + | ||
| 159 | - '100.00 | 50.00 | 5, 6', | ||
| 160 | - '# second.test.js | 100.00 ' + | ||
| 161 | - '| 100.00 | 100.00 | ', | ||
| 162 | - '# third.test.js | 100.00 | ' + | ||
| 163 | - '100.00 | 100.00 | ', | ||
| 164 | - '# all files | 92.11 | 72.73 | 88.89 |', | ||
| 159 | + '# -------------------------------------------------------------------', | ||
| 160 | + '# file | line % | branch % | funcs % | uncovered lines', | ||
| 161 | + '# -------------------------------------------------------------------', | ||
| 162 | + '# common.js | 89.86 | 62.50 | 100.00 | 8 13-14 18 34-35 53', | ||
| 163 | + '# first.test.js | 83.33 | 100.00 | 50.00 | 5-6', | ||
| 164 | + '# second.test.js | 100.00 | 100.00 | 100.00 | ', | ||
| 165 | + '# third.test.js | 100.00 | 100.00 | 100.00 | ', | ||
| 166 | + '# -------------------------------------------------------------------', | ||
| 167 | + '# all files | 92.11 | 72.73 | 88.89 |', | ||
| 168 | + '# -------------------------------------------------------------------', | ||
| 165 | 169 | '# end of coverage report', | |
| 166 | 170 | ].join('\n'); | |
| 167 | 171 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments