| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 336496b commit 45b0250
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -340,8 +340,8 @@ class TestCoverage { | |||
| 340 | 340 | const { data, lineLengths } = sourceMapCache[url]; | |
| 341 | 341 | let offset = 0; | |
| 342 | 342 | const executedLines = ArrayPrototypeMap(lineLengths, (length, i) => { | |
| 343 | - const coverageLine = new CoverageLine(i + 1, offset, null, length); | ||
| 344 | - offset += length; | ||
| 343 | + const coverageLine = new CoverageLine(i + 1, offset, null, length + 1); | ||
| 344 | + offset += length + 1; | ||
| 345 | 345 | return coverageLine; | |
| 346 | 346 | }); | |
| 347 | 347 | if (data.sourcesContent != null) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,76 @@ | |||
| 1 | + 1; | ||
| 2 | + 1; | ||
| 3 | + 1; | ||
| 4 | + 1; | ||
| 5 | + 1; | ||
| 6 | + 1; | ||
| 7 | + 1; | ||
| 8 | + 1; | ||
| 9 | + 1; | ||
| 10 | + 1; | ||
| 11 | + 1; | ||
| 12 | + 1; | ||
| 13 | + 1; | ||
| 14 | + 1; | ||
| 15 | + 1; | ||
| 16 | + 1; | ||
| 17 | + 1; | ||
| 18 | + 1; | ||
| 19 | + 1; | ||
| 20 | + 1; | ||
| 21 | + 1; | ||
| 22 | + 1; | ||
| 23 | + 1; | ||
| 24 | + 1; | ||
| 25 | + 1; | ||
| 26 | + 1; | ||
| 27 | + 1; | ||
| 28 | + 1; | ||
| 29 | + 1; | ||
| 30 | + 1; | ||
| 31 | + 1; | ||
| 32 | + 1; | ||
| 33 | + 1; | ||
| 34 | + 1; | ||
| 35 | + 1; | ||
| 36 | + 1; | ||
| 37 | + 1; | ||
| 38 | + 1; | ||
| 39 | + 1; | ||
| 40 | + 1; | ||
| 41 | + 1; | ||
| 42 | + 1; | ||
| 43 | + 1; | ||
| 44 | + 1; | ||
| 45 | + 1; | ||
| 46 | + 1; | ||
| 47 | + 1; | ||
| 48 | + 1; | ||
| 49 | + 1; | ||
| 50 | + 1; | ||
| 51 | + 1; | ||
| 52 | + 1; | ||
| 53 | + 1; | ||
| 54 | + 1; | ||
| 55 | + 1; | ||
| 56 | + 1; | ||
| 57 | + 1; | ||
| 58 | + 1; | ||
| 59 | + 1; | ||
| 60 | + 1; | ||
| 61 | + 1; | ||
| 62 | + 1; | ||
| 63 | + 1; | ||
| 64 | + 1; | ||
| 65 | + 1; | ||
| 66 | + 1; | ||
| 67 | + 1; | ||
| 68 | + 1; | ||
| 69 | + 1; | ||
| 70 | + 1; | ||
| 71 | + 1; | ||
| 72 | + 1; | ||
| 73 | + function a() { | ||
| 74 | + console.log(1); | ||
| 75 | + } | ||
| 76 | + a(); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -428,3 +428,16 @@ test('coverage with included and excluded files', skipIfNoInspector, () => { | |||
| 428 | 428 | assert.strictEqual(result.status, 0); | |
| 429 | 429 | assert(!findCoverageFileForPid(result.pid)); | |
| 430 | 430 | }); | |
| 431 | + | ||
| 432 | + test('properly accounts for line endings in source maps', skipIfNoInspector, () => { | ||
| 433 | + const fixture = fixtures.path('test-runner', 'source-map-line-lengths', 'index.js'); | ||
| 434 | + const args = [ | ||
| 435 | + '--test', '--experimental-test-coverage', '--test-reporter', 'tap', | ||
| 436 | + fixture, | ||
| 437 | + ]; | ||
| 438 | + const result = spawnSync(process.execPath, args); | ||
| 439 | + const report = 'index.ts | 100.00 | 100.00 | 100.00 |'; | ||
| 440 | + assert.strictEqual(result.stderr.toString(), ''); | ||
| 441 | + assert(result.stdout.toString().includes(report)); | ||
| 442 | + assert.strictEqual(result.status, 0); | ||
| 443 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments