-
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: avoid coverage report partial file names
Co-author: Medhansh404 <[email protected]> PR-URL: #54379 Fixes: #51299 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
- Loading branch information
Showing
19 changed files
with
544 additions
and
156 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
52 changes: 52 additions & 0 deletions
52
test/fixtures/test-runner/coverage-snap/a-very-long-long-long-sub-dir/c.js
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,52 @@ | ||
'use strict'; | ||
// Here we can't import common module as the coverage will be different based on the system | ||
|
||
// Empty functions that don't do anything | ||
function doNothing1() { | ||
// Not implemented | ||
} | ||
|
||
function doNothing2() { | ||
// No logic here | ||
} | ||
|
||
function unusedFunction1() { | ||
// Intentionally left empty | ||
} | ||
|
||
function unusedFunction2() { | ||
// Another empty function | ||
} | ||
|
||
// Unused variables | ||
const unusedVariable1 = 'This is never used'; | ||
const unusedVariable2 = 42; | ||
let unusedVariable3; | ||
|
||
// Empty class with no methods | ||
class UnusedClass { | ||
constructor() { | ||
// Constructor does nothing | ||
} | ||
} | ||
|
||
// Empty object literal | ||
const emptyObject = {}; | ||
|
||
// Empty array | ||
const emptyArray = []; | ||
|
||
// Function with parameters but no body | ||
function doNothingWithParams(param1, param2) { | ||
// No implementation | ||
} | ||
|
||
// Function that returns nothing | ||
function returnsNothing() { | ||
// No return statement | ||
} | ||
|
||
// Another unused function | ||
function unusedFunction3() { | ||
// More empty code | ||
} |
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,12 @@ | ||
// Flags: --experimental-test-coverage | ||
// here we can't import common module as the coverage will be different based on the system | ||
// Unused imports are here in order to populate the coverage report | ||
import * as a from '../coverage-snap/b.js'; | ||
import * as b from '../coverage-snap/a.js'; | ||
import * as c from '../coverage-snap/a-very-long-long-long-sub-dir/c.js'; | ||
|
||
import { test } from 'node:test'; | ||
|
||
process.stdout.columns = 40; | ||
|
||
test(`Coverage Print Fixed Width ${process.stdout.columns}`); |
Oops, something went wrong.