From e6a18f899c1e509d3b7a2c365196de6bb6efdace Mon Sep 17 00:00:00 2001 From: Pietro Marchini Date: Thu, 22 Aug 2024 15:49:55 +0200 Subject: [PATCH 1/2] test: add tests for runner coverage with different stdout column widths --- test/fixtures/test-runner/coverage-snap/a.mjs | 49 ++++ test/fixtures/test-runner/coverage-snap/b.mjs | 8 + .../coverage-snap/many-uncovered-lines.mjs | 225 ++++++++++++++++++ .../coverage-width-100-uncovered-lines.js | 9 + ...overage-width-100-uncovered-lines.snapshot | 27 +++ .../test-runner/output/coverage-width-100.js | 8 + .../output/coverage-width-100.snapshot | 26 ++ .../coverage-width-150-uncovered-lines.js | 9 + ...overage-width-150-uncovered-lines.snapshot | 27 +++ .../test-runner/output/coverage-width-150.js | 8 + .../output/coverage-width-150.snapshot | 26 ++ .../coverage-width-80-uncovered-lines.js | 9 + ...coverage-width-80-uncovered-lines.snapshot | 27 +++ .../test-runner/output/coverage-width-80.js | 8 + .../output/coverage-width-80.snapshot | 26 ++ ...coverage-width-infinity-uncovered-lines.js | 9 + ...ge-width-infinity-uncovered-lines.snapshot | 27 +++ .../output/coverage-width-infinity.js | 8 + .../output/coverage-width-infinity.snapshot | 26 ++ test/parallel/test-runner-output.mjs | 8 + 20 files changed, 570 insertions(+) create mode 100644 test/fixtures/test-runner/coverage-snap/a.mjs create mode 100644 test/fixtures/test-runner/coverage-snap/b.mjs create mode 100644 test/fixtures/test-runner/coverage-snap/many-uncovered-lines.mjs create mode 100644 test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.js create mode 100644 test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.snapshot create mode 100644 test/fixtures/test-runner/output/coverage-width-100.js create mode 100644 test/fixtures/test-runner/output/coverage-width-100.snapshot create mode 100644 test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.js create mode 100644 test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.snapshot create mode 100644 test/fixtures/test-runner/output/coverage-width-150.js create mode 100644 test/fixtures/test-runner/output/coverage-width-150.snapshot create mode 100644 test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.js create mode 100644 test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.snapshot create mode 100644 test/fixtures/test-runner/output/coverage-width-80.js create mode 100644 test/fixtures/test-runner/output/coverage-width-80.snapshot create mode 100644 test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.js create mode 100644 test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.snapshot create mode 100644 test/fixtures/test-runner/output/coverage-width-infinity.js create mode 100644 test/fixtures/test-runner/output/coverage-width-infinity.snapshot diff --git a/test/fixtures/test-runner/coverage-snap/a.mjs b/test/fixtures/test-runner/coverage-snap/a.mjs new file mode 100644 index 00000000000000..d9519c6d1b78eb --- /dev/null +++ b/test/fixtures/test-runner/coverage-snap/a.mjs @@ -0,0 +1,49 @@ +// 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 +} \ No newline at end of file diff --git a/test/fixtures/test-runner/coverage-snap/b.mjs b/test/fixtures/test-runner/coverage-snap/b.mjs new file mode 100644 index 00000000000000..1acff061fca21c --- /dev/null +++ b/test/fixtures/test-runner/coverage-snap/b.mjs @@ -0,0 +1,8 @@ +// Empty functions that don't do anything +function doNothing1() { + // Not implemented +} + +function doNothing2() { + // No logic here +} diff --git a/test/fixtures/test-runner/coverage-snap/many-uncovered-lines.mjs b/test/fixtures/test-runner/coverage-snap/many-uncovered-lines.mjs new file mode 100644 index 00000000000000..51fd63b3e0d90d --- /dev/null +++ b/test/fixtures/test-runner/coverage-snap/many-uncovered-lines.mjs @@ -0,0 +1,225 @@ +// 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 +} + +// Empty functions with different signatures +function doNothing4() { + // No logic here +} + +function doNothing5() { + // Another placeholder +} + +function doNothingWithRestParams(...args) { + // Function with rest parameters but no logic +} + +function doNothingWithCallback(callback) { + // Callback not called +} + +// Unused variables of different types +const unusedVariable7 = null; +const unusedVariable8 = undefined; +const unusedVariable9 = Symbol('unused'); +let unusedVariable10; + +// Another empty class +class YetAnotherUnusedClass { + // No properties or methods +} + +// Unused object with nested array +const unusedObjectWithArray = { + innerArray: [] +}; + +// Another empty array +const anotherEmptyArray = []; + +// Function with default and rest parameters +function anotherComplexFunction(param1 = 10, ...rest) { + // No implementation +} + +// More unused functions +function unusedFunction5() { + // Placeholder +} + +function unusedFunction6() { + // Empty again +} + +function unusedFunction7() { + // Still nothing here +} + +// Empty static method in class +class UnusedClassWithStaticMethod { + static unusedStaticMethod() { + // No logic inside static method + } +} + +// Empty getter and setter in a class +class ClassWithGetterSetter { + get unusedGetter() { + // Empty getter + } + + set unusedSetter(value) { + // Empty setter + } +} + +// Unused function returning undefined +function returnsUndefined() { + return undefined; +} + +// Empty promise-returning function +function emptyPromiseFunction() { + return new Promise((resolve, reject) => { + // No promise logic + }); +} + +// Empty immediately-invoked function expression (IIFE) +(function emptyIIFE() { + // No implementation +})(); + +// Unused generator function with parameters +function* unusedGeneratorFunctionWithParams(param1, param2) { + // No yielding of values +} + +// Unused async arrow function +const unusedAsyncArrowFunction = async () => { + // No async logic here +}; + +// Unused map function with no logic +const unusedMapFunction = new Map(); + +// Unused set function with no logic +const unusedSetFunction = new Set(); + +// Empty for loop +for (let i = 0; i < 10; i++) { + // Loop does nothing +} + +// Empty while loop +while (false) { + // Never executes +} + +// Empty try-catch-finally block +try { + // Nothing to try +} catch (error) { + // No error handling +} finally { + // Nothing to finalize +} + +// Empty if-else block +if (false) { + // No logic here +} else { + // Nothing here either +} + +// Empty switch statement +switch (false) { + case true: + // No case logic + break; + default: + // Default does nothing + break; +} + +// Empty nested function +function outerFunction() { + function innerFunction() { + // Empty inner function + } +} + +// More unused arrow functions +const unusedArrowFunction1 = () => {}; +const unusedArrowFunction2 = param => {}; + +// Empty function with a try-catch block +function emptyTryCatchFunction() { + try { + // Nothing to try + } catch (error) { + // No error handling + } +} + +// Unused async generator function +async function* unusedAsyncGenerator() { + // No async yielding +} + +// Unused function returning an empty array +function returnsEmptyArray() { + return []; +} + +// Unused function returning an empty object +function returnsEmptyObject() { + return {}; +} diff --git a/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.js b/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.js new file mode 100644 index 00000000000000..a48a59150d016c --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.js @@ -0,0 +1,9 @@ +// Flags: --experimental-test-coverage +import * as a from '../coverage-snap/b.mjs'; +import * as b from '../coverage-snap/a.mjs'; +import * as c from '../coverage-snap/many-uncovered-lines.mjs'; +import { test } from 'node:test'; + +process.stdout.columns = 100; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.snapshot b/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.snapshot new file mode 100644 index 00000000000000..fcecb2c0e230ec --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.snapshot @@ -0,0 +1,27 @@ +TAP version 13 +# Subtest: Coverage Print Fixed Width 100 +ok 1 - Coverage Print Fixed Width 100 + --- + 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 +# -------------------------------------------------------------------------------------------------- +# …runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 26-27 37-39 42-4… +# …runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 +# …p/many-uncovered-lines.mjs | 59.11 | 42.86 | 3.23 | 2-4 6-8 10-12 14-16 26-27 37-39 42-4… +# …dth-100-uncovered-lines.js | 100.00 | 100.00 | 100.00 | +# -------------------------------------------------------------------------------------------------- +# all files | 58.42 | 60.00 | 2.44 | +# -------------------------------------------------------------------------------------------------- +# end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-100.js b/test/fixtures/test-runner/output/coverage-width-100.js new file mode 100644 index 00000000000000..c10910176eb618 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-100.js @@ -0,0 +1,8 @@ +// Flags: --experimental-test-coverage +import * as a from '../coverage-snap/b.mjs'; +import * as b from '../coverage-snap/a.mjs'; +import { test } from 'node:test'; + +process.stdout.columns = 100; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-100.snapshot b/test/fixtures/test-runner/output/coverage-width-100.snapshot new file mode 100644 index 00000000000000..1402678b39f803 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-100.snapshot @@ -0,0 +1,26 @@ +TAP version 13 +# Subtest: Coverage Print Fixed Width 100 +ok 1 - Coverage Print Fixed Width 100 + --- + 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 +# -------------------------------------------------------------------------------------------------- +# test/fixtures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 1… +# test/fixtures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 +# …xtures/test-runner/output/coverage-width-100.js | 100.00 | 100.00 | 100.00 | +# -------------------------------------------------------------------------------------------------- +# all files | 55.38 | 100.00 | 0.00 | +# -------------------------------------------------------------------------------------------------- +# end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.js b/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.js new file mode 100644 index 00000000000000..06a06c63550900 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.js @@ -0,0 +1,9 @@ +// Flags: --experimental-test-coverage +import * as a from '../coverage-snap/b.mjs'; +import * as b from '../coverage-snap/a.mjs'; +import * as c from '../coverage-snap/many-uncovered-lines.mjs'; +import { test } from 'node:test'; + +process.stdout.columns = 150; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.snapshot b/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.snapshot new file mode 100644 index 00000000000000..923d65a82f6f97 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.snapshot @@ -0,0 +1,27 @@ +TAP version 13 +# Subtest: Coverage Print Fixed Width 150 +ok 1 - Coverage Print Fixed Width 150 + --- + 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 +# ---------------------------------------------------------------------------------------------------------------------------------------------------- +# …ures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 +# …ures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 +# …verage-snap/many-uncovered-lines.mjs | 59.11 | 42.86 | 3.23 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 52-54 56-58 60-62 64-66 88-90 93… +# …overage-width-150-uncovered-lines.js | 100.00 | 100.00 | 100.00 | +# ---------------------------------------------------------------------------------------------------------------------------------------------------- +# all files | 58.42 | 60.00 | 2.44 | +# ---------------------------------------------------------------------------------------------------------------------------------------------------- +# end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-150.js b/test/fixtures/test-runner/output/coverage-width-150.js new file mode 100644 index 00000000000000..44137c3f75d05f --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-150.js @@ -0,0 +1,8 @@ +// Flags: --experimental-test-coverage +import * as a from '../coverage-snap/b.mjs'; +import * as b from '../coverage-snap/a.mjs'; +import { test } from 'node:test'; + +process.stdout.columns = 150; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-150.snapshot b/test/fixtures/test-runner/output/coverage-width-150.snapshot new file mode 100644 index 00000000000000..5f5a86304f6c32 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-150.snapshot @@ -0,0 +1,26 @@ +TAP version 13 +# Subtest: Coverage Print Fixed Width 150 +ok 1 - Coverage Print Fixed Width 150 + --- + 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 +# ----------------------------------------------------------------------------------------------------------------------------------- +# test/fixtures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 +# test/fixtures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 +# test/fixtures/test-runner/output/coverage-width-150.js | 100.00 | 100.00 | 100.00 | +# ----------------------------------------------------------------------------------------------------------------------------------- +# all files | 55.38 | 100.00 | 0.00 | +# ----------------------------------------------------------------------------------------------------------------------------------- +# end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.js b/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.js new file mode 100644 index 00000000000000..744cbbec68fcbd --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.js @@ -0,0 +1,9 @@ +// Flags: --experimental-test-coverage +import * as a from '../coverage-snap/b.mjs'; +import * as b from '../coverage-snap/a.mjs'; +import * as c from '../coverage-snap/many-uncovered-lines.mjs'; +import { test } from 'node:test'; + +process.stdout.columns = 80; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.snapshot b/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.snapshot new file mode 100644 index 00000000000000..ec41cdb62ad439 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.snapshot @@ -0,0 +1,27 @@ +TAP version 13 +# Subtest: Coverage Print Fixed Width 80 +ok 1 - Coverage Print Fixed Width 80 + --- + 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 +# ------------------------------------------------------------------------------ +# …er/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 … +# …er/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 +# …ny-uncovered-lines.mjs | 59.11 | 42.86 | 3.23 | 2-4 6-8 10-12 14-16 … +# …-80-uncovered-lines.js | 100.00 | 100.00 | 100.00 | +# ------------------------------------------------------------------------------ +# all files | 58.42 | 60.00 | 2.44 | +# ------------------------------------------------------------------------------ +# end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-80.js b/test/fixtures/test-runner/output/coverage-width-80.js new file mode 100644 index 00000000000000..cacaa2cca40050 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-80.js @@ -0,0 +1,8 @@ +// Flags: --experimental-test-coverage +import * as a from '../coverage-snap/b.mjs'; +import * as b from '../coverage-snap/a.mjs'; +import { test } from 'node:test'; + +process.stdout.columns = 80; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-80.snapshot b/test/fixtures/test-runner/output/coverage-width-80.snapshot new file mode 100644 index 00000000000000..a5ee3774595c5a --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-80.snapshot @@ -0,0 +1,26 @@ +TAP version 13 +# Subtest: Coverage Print Fixed Width 80 +ok 1 - Coverage Print Fixed Width 80 + --- + 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 % | … +# ------------------------------------------------------------------------------ +# …t/fixtures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | … +# …t/fixtures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | … +# …es/test-runner/output/coverage-width-80.js | 100.00 | 100.00 | 100.00 | +# ------------------------------------------------------------------------------ +# all files | 55.38 | 100.00 | 0.00 | +# ------------------------------------------------------------------------------ +# end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.js b/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.js new file mode 100644 index 00000000000000..c59d5af5c36014 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.js @@ -0,0 +1,9 @@ +// Flags: --experimental-test-coverage +import * as a from '../coverage-snap/b.mjs'; +import * as b from '../coverage-snap/a.mjs'; +import * as c from '../coverage-snap/many-uncovered-lines.mjs'; +import { test } from 'node:test'; + +process.stdout.columns = Infinity; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.snapshot b/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.snapshot new file mode 100644 index 00000000000000..b63bfd96bdbb0d --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.snapshot @@ -0,0 +1,27 @@ +TAP version 13 +# Subtest: Coverage Print Fixed Width Infinity +ok 1 - Coverage Print Fixed Width Infinity + --- + 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 +# ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +# test/fixtures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 +# test/fixtures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 +# test/fixtures/test-runner/coverage-snap/many-uncovered-lines.mjs | 59.11 | 42.86 | 3.23 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 52-54 56-58 60-62 64-66 88-90 93-95 97-99 101-103 108-109 115-116 119-120 124-126 129-133 141-143 147 163-164 170 177 185-186 193-197 204-210 213-215 218-220 223-225 +# test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.js | 100.00 | 100.00 | 100.00 | +# ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +# all files | 58.42 | 60.00 | 2.44 | +# ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +# end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-infinity.js b/test/fixtures/test-runner/output/coverage-width-infinity.js new file mode 100644 index 00000000000000..25b32066097d57 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-infinity.js @@ -0,0 +1,8 @@ +// Flags: --experimental-test-coverage +import * as a from '../coverage-snap/b.mjs'; +import * as b from '../coverage-snap/a.mjs'; +import { test } from 'node:test'; + +process.stdout.columns = Infinity; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-infinity.snapshot b/test/fixtures/test-runner/output/coverage-width-infinity.snapshot new file mode 100644 index 00000000000000..20a54f93874fde --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-infinity.snapshot @@ -0,0 +1,26 @@ +TAP version 13 +# Subtest: Coverage Print Fixed Width Infinity +ok 1 - Coverage Print Fixed Width Infinity + --- + 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 +# ---------------------------------------------------------------------------------------------------------------------------------------- +# test/fixtures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 +# test/fixtures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 +# test/fixtures/test-runner/output/coverage-width-infinity.js | 100.00 | 100.00 | 100.00 | +# ---------------------------------------------------------------------------------------------------------------------------------------- +# all files | 55.38 | 100.00 | 0.00 | +# ---------------------------------------------------------------------------------------------------------------------------------------- +# end of coverage report diff --git a/test/parallel/test-runner-output.mjs b/test/parallel/test-runner-output.mjs index 0125a8168e4464..95ed7f3bf62df8 100644 --- a/test/parallel/test-runner-output.mjs +++ b/test/parallel/test-runner-output.mjs @@ -151,6 +151,14 @@ const tests = [ { name: 'test-runner/output/test-runner-plan.js' }, process.features.inspector ? { name: 'test-runner/output/coverage_failure.js' } : false, { name: 'test-runner/output/test-diagnostic-warning-without-test-only-flag.js' }, + process.features.inspector ? { name: 'test-runner/output/coverage-width-80.js' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-100.js' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-150.js' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-infinity.js' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-80-uncovered-lines.js' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-100-uncovered-lines.js' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-150-uncovered-lines.js' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-infinity-uncovered-lines.js' } : false, ] .filter(Boolean) .map(({ name, tty, transform }) => ({ From 3f5526ee43eef2c6614d047482597c04d8128c49 Mon Sep 17 00:00:00 2001 From: Pietro Marchini Date: Fri, 23 Aug 2024 13:25:06 +0200 Subject: [PATCH 2/2] test: lint fixtures --- .../test-runner/coverage-snap/{a.mjs => a.js} | 27 +- test/fixtures/test-runner/coverage-snap/b.js | 11 + test/fixtures/test-runner/coverage-snap/b.mjs | 8 - .../coverage-snap/many-uncovered-lines.js | 353 ++++++++++++++++++ .../coverage-snap/many-uncovered-lines.mjs | 225 ----------- .../coverage-width-100-uncovered-lines.js | 9 - .../coverage-width-100-uncovered-lines.mjs | 12 + ...overage-width-100-uncovered-lines.snapshot | 12 +- .../test-runner/output/coverage-width-100.js | 8 - .../test-runner/output/coverage-width-100.mjs | 11 + .../output/coverage-width-100.snapshot | 8 +- .../coverage-width-150-uncovered-lines.js | 9 - .../coverage-width-150-uncovered-lines.mjs | 12 + ...overage-width-150-uncovered-lines.snapshot | 12 +- .../test-runner/output/coverage-width-150.js | 8 - .../test-runner/output/coverage-width-150.mjs | 11 + .../output/coverage-width-150.snapshot | 18 +- .../coverage-width-80-uncovered-lines.js | 9 - .../coverage-width-80-uncovered-lines.mjs | 12 + ...coverage-width-80-uncovered-lines.snapshot | 24 +- .../test-runner/output/coverage-width-80.js | 8 - .../test-runner/output/coverage-width-80.mjs | 11 + .../output/coverage-width-80.snapshot | 10 +- ...coverage-width-infinity-uncovered-lines.js | 9 - ...overage-width-infinity-uncovered-lines.mjs | 12 + ...ge-width-infinity-uncovered-lines.snapshot | 20 +- .../output/coverage-width-infinity.js | 8 - .../output/coverage-width-infinity.mjs | 11 + .../output/coverage-width-infinity.snapshot | 18 +- test/parallel/test-runner-output.mjs | 16 +- 30 files changed, 540 insertions(+), 382 deletions(-) rename test/fixtures/test-runner/coverage-snap/{a.mjs => a.js} (60%) create mode 100644 test/fixtures/test-runner/coverage-snap/b.js delete mode 100644 test/fixtures/test-runner/coverage-snap/b.mjs create mode 100644 test/fixtures/test-runner/coverage-snap/many-uncovered-lines.js delete mode 100644 test/fixtures/test-runner/coverage-snap/many-uncovered-lines.mjs delete mode 100644 test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.js create mode 100644 test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.mjs delete mode 100644 test/fixtures/test-runner/output/coverage-width-100.js create mode 100644 test/fixtures/test-runner/output/coverage-width-100.mjs delete mode 100644 test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.js create mode 100644 test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.mjs delete mode 100644 test/fixtures/test-runner/output/coverage-width-150.js create mode 100644 test/fixtures/test-runner/output/coverage-width-150.mjs delete mode 100644 test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.js create mode 100644 test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.mjs delete mode 100644 test/fixtures/test-runner/output/coverage-width-80.js create mode 100644 test/fixtures/test-runner/output/coverage-width-80.mjs delete mode 100644 test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.js create mode 100644 test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.mjs delete mode 100644 test/fixtures/test-runner/output/coverage-width-infinity.js create mode 100644 test/fixtures/test-runner/output/coverage-width-infinity.mjs diff --git a/test/fixtures/test-runner/coverage-snap/a.mjs b/test/fixtures/test-runner/coverage-snap/a.js similarity index 60% rename from test/fixtures/test-runner/coverage-snap/a.mjs rename to test/fixtures/test-runner/coverage-snap/a.js index d9519c6d1b78eb..73ac49a524e60b 100644 --- a/test/fixtures/test-runner/coverage-snap/a.mjs +++ b/test/fixtures/test-runner/coverage-snap/a.js @@ -1,30 +1,33 @@ +'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 + // Not implemented } function doNothing2() { - // No logic here + // No logic here } function unusedFunction1() { - // Intentionally left empty + // Intentionally left empty } function unusedFunction2() { - // Another empty function + // Another empty function } // Unused variables -const unusedVariable1 = "This is never used"; +const unusedVariable1 = 'This is never used'; const unusedVariable2 = 42; let unusedVariable3; // Empty class with no methods class UnusedClass { - constructor() { - // Constructor does nothing - } + constructor() { + // Constructor does nothing + } } // Empty object literal @@ -35,15 +38,15 @@ const emptyArray = []; // Function with parameters but no body function doNothingWithParams(param1, param2) { - // No implementation + // No implementation } // Function that returns nothing function returnsNothing() { - // No return statement + // No return statement } // Another unused function function unusedFunction3() { - // More empty code -} \ No newline at end of file + // More empty code +} diff --git a/test/fixtures/test-runner/coverage-snap/b.js b/test/fixtures/test-runner/coverage-snap/b.js new file mode 100644 index 00000000000000..7f6a712f6ddcf2 --- /dev/null +++ b/test/fixtures/test-runner/coverage-snap/b.js @@ -0,0 +1,11 @@ +'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 +} diff --git a/test/fixtures/test-runner/coverage-snap/b.mjs b/test/fixtures/test-runner/coverage-snap/b.mjs deleted file mode 100644 index 1acff061fca21c..00000000000000 --- a/test/fixtures/test-runner/coverage-snap/b.mjs +++ /dev/null @@ -1,8 +0,0 @@ -// Empty functions that don't do anything -function doNothing1() { - // Not implemented -} - -function doNothing2() { - // No logic here -} diff --git a/test/fixtures/test-runner/coverage-snap/many-uncovered-lines.js b/test/fixtures/test-runner/coverage-snap/many-uncovered-lines.js new file mode 100644 index 00000000000000..fa0304526a30be --- /dev/null +++ b/test/fixtures/test-runner/coverage-snap/many-uncovered-lines.js @@ -0,0 +1,353 @@ +'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 +} + +// Empty functions with different signatures +function doNothing4() { + // No logic here +} + +function doNothing5() { + // Another placeholder +} + +function doNothingWithRestParams(...args) { + // Function with rest parameters but no logic +} + +function doNothingWithCallback(callback) { + // Callback not called +} + +// Unused variables of different types +const unusedVariable7 = null; +const unusedVariable8 = undefined; +const unusedVariable9 = Symbol('unused'); +let unusedVariable10; + +// Another empty class +class YetAnotherUnusedClass { + // No properties or methods +} + +// Unused object with nested array +const unusedObjectWithArray = { + innerArray: [], +}; + +// Another empty array +const anotherEmptyArray = []; + +// Function with default and rest parameters +function anotherComplexFunction(param1 = 10, ...rest) { + // No implementation +} + +// More unused functions +function unusedFunction5() { + // Placeholder +} + +function unusedFunction6() { + // Empty again +} + +function unusedFunction7() { + // Still nothing here +} + +// Empty static method in class +class UnusedClassWithStaticMethod { + static unusedStaticMethod() { + // No logic inside static method + } +} + +// Empty getter and setter in a class +class ClassWithGetterSetter { + get unusedGetter() { + // Empty getter + } + + set unusedSetter(value) { + // Empty setter + } +} + +// Unused function returning undefined +function returnsUndefined() { + return undefined; +} + +// Empty promise-returning function +function emptyPromiseFunction() { + return new Promise((resolve, reject) => { + // No promise logic + }); +} + +// Empty immediately-invoked function expression (IIFE) +(function emptyIIFE() { + // No implementation +})(); + +// Unused generator function with parameters +function* unusedGeneratorFunctionWithParams(param1, param2) { + // No yielding of values +} + +// Unused async arrow function +const unusedAsyncArrowFunction = async () => { + // No async logic here +}; + +// Unused map function with no logic +const unusedMapFunction = new Map(); + +// Unused set function with no logic +const unusedSetFunction = new Set(); + +// Empty for loop +for (let i = 0; i < 10; i++) { + // Loop does nothing +} + +// Empty while loop +while (false) { + // Never executes +} + +// Empty try-catch-finally block +try { + // Nothing to try +} catch (error) { + // No error handling +} finally { + // Nothing to finalize +} + +// Empty if-else block +if (false) { + // No logic here +} else { + // Nothing here either +} + +// Empty switch statement +switch (false) { + case true: + // No case logic + break; + default: + // Default does nothing + break; +} + +// Empty nested function +function outerFunction() { + function innerFunction() { + // Empty inner function + } +} + +// More unused arrow functions +const unusedArrowFunction1 = () => {}; +const unusedArrowFunction2 = (param) => {}; + +// Empty function with a try-catch block +function emptyTryCatchFunction() { + try { + // Nothing to try + } catch (error) { + // No error handling + } +} + +// Unused async generator function +async function* unusedAsyncGenerator() { + // No async yielding +} + +// Unused function returning an empty array +function returnsEmptyArray() { + return []; +} + +// Unused function returning an empty object +function returnsEmptyObject() { + return {}; +} + +// Empty arrow function with destructuring +const unusedArrowFunctionWithDestructuring = ({ key1, key2 }) => { + // No logic here +}; + +// Unused function with default parameters +function unusedFunctionWithDefaults(param1 = 'default', param2 = 100) { + // No implementation +} + +// Unused function returning an empty Map +function returnsEmptyMap() { + return new Map(); +} + +// Unused function returning an empty Set +function returnsEmptySet() { + return new Set(); +} + +// Unused async function with try-catch +async function unusedAsyncFunctionWithTryCatch() { + try { + // Nothing to try + } catch (error) { + // No error handling + } +} + +// Function with spread operator but no logic +function unusedFunctionWithSpread(...args) { + // No implementation +} + +// Function with object spread but no logic +function unusedFunctionWithObjectSpread(obj) { + const newObj = { ...obj }; + // No logic here +} + +// Empty function that takes an array and does nothing +function unusedFunctionWithArrayParam(arr) { + // No logic here +} + +// Empty function that returns a function +function unusedFunctionReturningFunction() { + return function() { + // Empty function returned + }; +} + +// Empty function with destructuring and rest parameters +function unusedFunctionWithDestructuringAndRest({ a, b, ...rest }) { + // No logic here +} + +// Unused async function that returns a promise +async function unusedAsyncFunctionReturningPromise() { + return Promise.resolve(); +} + +// Empty recursive function +function unusedRecursiveFunction() { + // No recursive logic +} + +// Empty function using template literals +function unusedFunctionWithTemplateLiterals(param) { + const message = `Message: ${param}`; + // No further logic +} + +// Function with complex destructuring and no logic +function unusedComplexDestructuringFunction({ a: { b, c }, d }) { + // No logic here +} + +// Empty function that uses bitwise operations +function unusedFunctionWithBitwiseOperations(num) { + const result = num & 0xff; + // No further logic +} + +// Unused function with optional chaining +function unusedFunctionWithOptionalChaining(obj) { + const value = obj?.property?.nestedProperty; + // No further logic +} + +// Unused function with nullish coalescing operator +function unusedFunctionWithNullishCoalescing(param) { + const value = param ?? 'default'; + // No further logic +} + +// Unused generator function returning nothing +function* unusedGeneratorFunction() { + // No yielding +} + +// Function using try-catch with finally, but no logic +function unusedFunctionWithTryCatchFinally() { + try { + // Nothing to try + } catch (e) { + // No error handling + } finally { + // Nothing in finally + } +} + +// Function with chaining but no logic +function unusedFunctionWithChaining() { + const obj = { + method1: () => ({ method2: () => {} }), + }; + obj.method1().method2(); +} + +// Empty function returning a new Date object +function unusedFunctionReturningDate() { + return new Date(); +} diff --git a/test/fixtures/test-runner/coverage-snap/many-uncovered-lines.mjs b/test/fixtures/test-runner/coverage-snap/many-uncovered-lines.mjs deleted file mode 100644 index 51fd63b3e0d90d..00000000000000 --- a/test/fixtures/test-runner/coverage-snap/many-uncovered-lines.mjs +++ /dev/null @@ -1,225 +0,0 @@ -// 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 -} - -// Empty functions with different signatures -function doNothing4() { - // No logic here -} - -function doNothing5() { - // Another placeholder -} - -function doNothingWithRestParams(...args) { - // Function with rest parameters but no logic -} - -function doNothingWithCallback(callback) { - // Callback not called -} - -// Unused variables of different types -const unusedVariable7 = null; -const unusedVariable8 = undefined; -const unusedVariable9 = Symbol('unused'); -let unusedVariable10; - -// Another empty class -class YetAnotherUnusedClass { - // No properties or methods -} - -// Unused object with nested array -const unusedObjectWithArray = { - innerArray: [] -}; - -// Another empty array -const anotherEmptyArray = []; - -// Function with default and rest parameters -function anotherComplexFunction(param1 = 10, ...rest) { - // No implementation -} - -// More unused functions -function unusedFunction5() { - // Placeholder -} - -function unusedFunction6() { - // Empty again -} - -function unusedFunction7() { - // Still nothing here -} - -// Empty static method in class -class UnusedClassWithStaticMethod { - static unusedStaticMethod() { - // No logic inside static method - } -} - -// Empty getter and setter in a class -class ClassWithGetterSetter { - get unusedGetter() { - // Empty getter - } - - set unusedSetter(value) { - // Empty setter - } -} - -// Unused function returning undefined -function returnsUndefined() { - return undefined; -} - -// Empty promise-returning function -function emptyPromiseFunction() { - return new Promise((resolve, reject) => { - // No promise logic - }); -} - -// Empty immediately-invoked function expression (IIFE) -(function emptyIIFE() { - // No implementation -})(); - -// Unused generator function with parameters -function* unusedGeneratorFunctionWithParams(param1, param2) { - // No yielding of values -} - -// Unused async arrow function -const unusedAsyncArrowFunction = async () => { - // No async logic here -}; - -// Unused map function with no logic -const unusedMapFunction = new Map(); - -// Unused set function with no logic -const unusedSetFunction = new Set(); - -// Empty for loop -for (let i = 0; i < 10; i++) { - // Loop does nothing -} - -// Empty while loop -while (false) { - // Never executes -} - -// Empty try-catch-finally block -try { - // Nothing to try -} catch (error) { - // No error handling -} finally { - // Nothing to finalize -} - -// Empty if-else block -if (false) { - // No logic here -} else { - // Nothing here either -} - -// Empty switch statement -switch (false) { - case true: - // No case logic - break; - default: - // Default does nothing - break; -} - -// Empty nested function -function outerFunction() { - function innerFunction() { - // Empty inner function - } -} - -// More unused arrow functions -const unusedArrowFunction1 = () => {}; -const unusedArrowFunction2 = param => {}; - -// Empty function with a try-catch block -function emptyTryCatchFunction() { - try { - // Nothing to try - } catch (error) { - // No error handling - } -} - -// Unused async generator function -async function* unusedAsyncGenerator() { - // No async yielding -} - -// Unused function returning an empty array -function returnsEmptyArray() { - return []; -} - -// Unused function returning an empty object -function returnsEmptyObject() { - return {}; -} diff --git a/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.js b/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.js deleted file mode 100644 index a48a59150d016c..00000000000000 --- a/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.js +++ /dev/null @@ -1,9 +0,0 @@ -// Flags: --experimental-test-coverage -import * as a from '../coverage-snap/b.mjs'; -import * as b from '../coverage-snap/a.mjs'; -import * as c from '../coverage-snap/many-uncovered-lines.mjs'; -import { test } from 'node:test'; - -process.stdout.columns = 100; - -test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.mjs b/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.mjs new file mode 100644 index 00000000000000..e6ba0bef63fa22 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.mjs @@ -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/many-uncovered-lines.js'; + +import { test } from 'node:test'; + +process.stdout.columns = 100; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); diff --git a/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.snapshot b/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.snapshot index fcecb2c0e230ec..560b4e6d13e15b 100644 --- a/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.snapshot +++ b/test/fixtures/test-runner/output/coverage-width-100-uncovered-lines.snapshot @@ -15,13 +15,13 @@ ok 1 - Coverage Print Fixed Width 100 # duration_ms * # start of coverage report # -------------------------------------------------------------------------------------------------- -# file | line % | branch % | funcs % | uncovered lines +# file | line % | branch % | funcs % | uncovered lines # -------------------------------------------------------------------------------------------------- -# …runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 26-27 37-39 42-4… -# …runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 -# …p/many-uncovered-lines.mjs | 59.11 | 42.86 | 3.23 | 2-4 6-8 10-12 14-16 26-27 37-39 42-4… -# …dth-100-uncovered-lines.js | 100.00 | 100.00 | 100.00 | +# …ap/a.js | 55.77 | 100.00 | 0.00 | 5-7 9-11 13-15 17-19 29-30 40-42 45-47 50-52 +# …ap/b.js | 45.45 | 100.00 | 0.00 | 5-7 9-11 +# …ines.js | 50.99 | 42.86 | 1.92 | 5-7 9-11 13-15 17-19 29-30 40-42 45-47 50-52 55-57 59-6… +# …nes.mjs | 100.00 | 100.00 | 100.00 | # -------------------------------------------------------------------------------------------------- -# all files | 58.42 | 60.00 | 2.44 | +# all fil… | 52.80 | 60.00 | 1.61 | # -------------------------------------------------------------------------------------------------- # end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-100.js b/test/fixtures/test-runner/output/coverage-width-100.js deleted file mode 100644 index c10910176eb618..00000000000000 --- a/test/fixtures/test-runner/output/coverage-width-100.js +++ /dev/null @@ -1,8 +0,0 @@ -// Flags: --experimental-test-coverage -import * as a from '../coverage-snap/b.mjs'; -import * as b from '../coverage-snap/a.mjs'; -import { test } from 'node:test'; - -process.stdout.columns = 100; - -test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-100.mjs b/test/fixtures/test-runner/output/coverage-width-100.mjs new file mode 100644 index 00000000000000..1e4f299217a023 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-100.mjs @@ -0,0 +1,11 @@ +// 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 { test } from 'node:test'; + +process.stdout.columns = 100; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); diff --git a/test/fixtures/test-runner/output/coverage-width-100.snapshot b/test/fixtures/test-runner/output/coverage-width-100.snapshot index 1402678b39f803..a452e0389967db 100644 --- a/test/fixtures/test-runner/output/coverage-width-100.snapshot +++ b/test/fixtures/test-runner/output/coverage-width-100.snapshot @@ -17,10 +17,10 @@ ok 1 - Coverage Print Fixed Width 100 # -------------------------------------------------------------------------------------------------- # file | line % | branch % | funcs % | uncovered lines # -------------------------------------------------------------------------------------------------- -# test/fixtures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 1… -# test/fixtures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 -# …xtures/test-runner/output/coverage-width-100.js | 100.00 | 100.00 | 100.00 | +# test/fixtures/test-runner/coverage-snap/a.js | 55.77 | 100.00 | 0.00 | 5-7 9-11 13-15 … +# test/fixtures/test-runner/coverage-snap/b.js | 45.45 | 100.00 | 0.00 | 5-7 9-11 +# …tures/test-runner/output/coverage-width-100.mjs | 100.00 | 100.00 | 100.00 | # -------------------------------------------------------------------------------------------------- -# all files | 55.38 | 100.00 | 0.00 | +# all files | 60.81 | 100.00 | 0.00 | # -------------------------------------------------------------------------------------------------- # end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.js b/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.js deleted file mode 100644 index 06a06c63550900..00000000000000 --- a/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.js +++ /dev/null @@ -1,9 +0,0 @@ -// Flags: --experimental-test-coverage -import * as a from '../coverage-snap/b.mjs'; -import * as b from '../coverage-snap/a.mjs'; -import * as c from '../coverage-snap/many-uncovered-lines.mjs'; -import { test } from 'node:test'; - -process.stdout.columns = 150; - -test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.mjs b/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.mjs new file mode 100644 index 00000000000000..bbe642b1bfa171 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.mjs @@ -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/many-uncovered-lines.js'; + +import { test } from 'node:test'; + +process.stdout.columns = 150; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); diff --git a/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.snapshot b/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.snapshot index 923d65a82f6f97..01f94f2d40a9e6 100644 --- a/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.snapshot +++ b/test/fixtures/test-runner/output/coverage-width-150-uncovered-lines.snapshot @@ -15,13 +15,13 @@ ok 1 - Coverage Print Fixed Width 150 # duration_ms * # start of coverage report # ---------------------------------------------------------------------------------------------------------------------------------------------------- -# file | line % | branch % | funcs % | uncovered lines +# file | line % | branch % | funcs % | uncovered lines # ---------------------------------------------------------------------------------------------------------------------------------------------------- -# …ures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 -# …ures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 -# …verage-snap/many-uncovered-lines.mjs | 59.11 | 42.86 | 3.23 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 52-54 56-58 60-62 64-66 88-90 93… -# …overage-width-150-uncovered-lines.js | 100.00 | 100.00 | 100.00 | +# …ap/a.js | 55.77 | 100.00 | 0.00 | 5-7 9-11 13-15 17-19 29-30 40-42 45-47 50-52 +# …ap/b.js | 45.45 | 100.00 | 0.00 | 5-7 9-11 +# …ines.js | 50.99 | 42.86 | 1.92 | 5-7 9-11 13-15 17-19 29-30 40-42 45-47 50-52 55-57 59-61 63-65 67-69 91-93 96-98 100-102 104-106 111-112 … +# …nes.mjs | 100.00 | 100.00 | 100.00 | # ---------------------------------------------------------------------------------------------------------------------------------------------------- -# all files | 58.42 | 60.00 | 2.44 | +# all fil… | 52.80 | 60.00 | 1.61 | # ---------------------------------------------------------------------------------------------------------------------------------------------------- # end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-150.js b/test/fixtures/test-runner/output/coverage-width-150.js deleted file mode 100644 index 44137c3f75d05f..00000000000000 --- a/test/fixtures/test-runner/output/coverage-width-150.js +++ /dev/null @@ -1,8 +0,0 @@ -// Flags: --experimental-test-coverage -import * as a from '../coverage-snap/b.mjs'; -import * as b from '../coverage-snap/a.mjs'; -import { test } from 'node:test'; - -process.stdout.columns = 150; - -test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-150.mjs b/test/fixtures/test-runner/output/coverage-width-150.mjs new file mode 100644 index 00000000000000..bc1c38957a99b1 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-150.mjs @@ -0,0 +1,11 @@ +// 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 { test } from 'node:test'; + +process.stdout.columns = 150; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); diff --git a/test/fixtures/test-runner/output/coverage-width-150.snapshot b/test/fixtures/test-runner/output/coverage-width-150.snapshot index 5f5a86304f6c32..37cc1e799fc550 100644 --- a/test/fixtures/test-runner/output/coverage-width-150.snapshot +++ b/test/fixtures/test-runner/output/coverage-width-150.snapshot @@ -14,13 +14,13 @@ ok 1 - Coverage Print Fixed Width 150 # todo 0 # duration_ms * # start of coverage report -# ----------------------------------------------------------------------------------------------------------------------------------- -# file | line % | branch % | funcs % | uncovered lines -# ----------------------------------------------------------------------------------------------------------------------------------- -# test/fixtures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 -# test/fixtures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 -# test/fixtures/test-runner/output/coverage-width-150.js | 100.00 | 100.00 | 100.00 | -# ----------------------------------------------------------------------------------------------------------------------------------- -# all files | 55.38 | 100.00 | 0.00 | -# ----------------------------------------------------------------------------------------------------------------------------------- +# ------------------------------------------------------------------------------------------------------------------------------------- +# file | line % | branch % | funcs % | uncovered lines +# ------------------------------------------------------------------------------------------------------------------------------------- +# test/fixtures/test-runner/coverage-snap/a.js | 55.77 | 100.00 | 0.00 | 5-7 9-11 13-15 17-19 29-30 40-42 45-47 50-52 +# test/fixtures/test-runner/coverage-snap/b.js | 45.45 | 100.00 | 0.00 | 5-7 9-11 +# test/fixtures/test-runner/output/coverage-width-150.mjs | 100.00 | 100.00 | 100.00 | +# ------------------------------------------------------------------------------------------------------------------------------------- +# all files | 60.81 | 100.00 | 0.00 | +# ------------------------------------------------------------------------------------------------------------------------------------- # end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.js b/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.js deleted file mode 100644 index 744cbbec68fcbd..00000000000000 --- a/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.js +++ /dev/null @@ -1,9 +0,0 @@ -// Flags: --experimental-test-coverage -import * as a from '../coverage-snap/b.mjs'; -import * as b from '../coverage-snap/a.mjs'; -import * as c from '../coverage-snap/many-uncovered-lines.mjs'; -import { test } from 'node:test'; - -process.stdout.columns = 80; - -test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.mjs b/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.mjs new file mode 100644 index 00000000000000..e6ba0bef63fa22 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.mjs @@ -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/many-uncovered-lines.js'; + +import { test } from 'node:test'; + +process.stdout.columns = 100; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); diff --git a/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.snapshot b/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.snapshot index ec41cdb62ad439..560b4e6d13e15b 100644 --- a/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.snapshot +++ b/test/fixtures/test-runner/output/coverage-width-80-uncovered-lines.snapshot @@ -1,6 +1,6 @@ TAP version 13 -# Subtest: Coverage Print Fixed Width 80 -ok 1 - Coverage Print Fixed Width 80 +# Subtest: Coverage Print Fixed Width 100 +ok 1 - Coverage Print Fixed Width 100 --- duration_ms: * ... @@ -14,14 +14,14 @@ ok 1 - Coverage Print Fixed Width 80 # todo 0 # duration_ms * # start of coverage report -# ------------------------------------------------------------------------------ -# file | line % | branch % | funcs % | uncovered lines -# ------------------------------------------------------------------------------ -# …er/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 … -# …er/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 -# …ny-uncovered-lines.mjs | 59.11 | 42.86 | 3.23 | 2-4 6-8 10-12 14-16 … -# …-80-uncovered-lines.js | 100.00 | 100.00 | 100.00 | -# ------------------------------------------------------------------------------ -# all files | 58.42 | 60.00 | 2.44 | -# ------------------------------------------------------------------------------ +# -------------------------------------------------------------------------------------------------- +# file | line % | branch % | funcs % | uncovered lines +# -------------------------------------------------------------------------------------------------- +# …ap/a.js | 55.77 | 100.00 | 0.00 | 5-7 9-11 13-15 17-19 29-30 40-42 45-47 50-52 +# …ap/b.js | 45.45 | 100.00 | 0.00 | 5-7 9-11 +# …ines.js | 50.99 | 42.86 | 1.92 | 5-7 9-11 13-15 17-19 29-30 40-42 45-47 50-52 55-57 59-6… +# …nes.mjs | 100.00 | 100.00 | 100.00 | +# -------------------------------------------------------------------------------------------------- +# all fil… | 52.80 | 60.00 | 1.61 | +# -------------------------------------------------------------------------------------------------- # end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-80.js b/test/fixtures/test-runner/output/coverage-width-80.js deleted file mode 100644 index cacaa2cca40050..00000000000000 --- a/test/fixtures/test-runner/output/coverage-width-80.js +++ /dev/null @@ -1,8 +0,0 @@ -// Flags: --experimental-test-coverage -import * as a from '../coverage-snap/b.mjs'; -import * as b from '../coverage-snap/a.mjs'; -import { test } from 'node:test'; - -process.stdout.columns = 80; - -test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-80.mjs b/test/fixtures/test-runner/output/coverage-width-80.mjs new file mode 100644 index 00000000000000..190dfa087b4276 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-80.mjs @@ -0,0 +1,11 @@ +// 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 { test } from 'node:test'; + +process.stdout.columns = 80; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); diff --git a/test/fixtures/test-runner/output/coverage-width-80.snapshot b/test/fixtures/test-runner/output/coverage-width-80.snapshot index a5ee3774595c5a..d4a485f45944bf 100644 --- a/test/fixtures/test-runner/output/coverage-width-80.snapshot +++ b/test/fixtures/test-runner/output/coverage-width-80.snapshot @@ -15,12 +15,12 @@ ok 1 - Coverage Print Fixed Width 80 # duration_ms * # start of coverage report # ------------------------------------------------------------------------------ -# file | line % | branch % | funcs % | … +# file | line % | branch % | funcs % | … # ------------------------------------------------------------------------------ -# …t/fixtures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | … -# …t/fixtures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | … -# …es/test-runner/output/coverage-width-80.js | 100.00 | 100.00 | 100.00 | +# test/fixtures/test-runner/coverage-snap/a.js | 55.77 | 100.00 | 0.00 | … +# test/fixtures/test-runner/coverage-snap/b.js | 45.45 | 100.00 | 0.00 | … +# …es/test-runner/output/coverage-width-80.mjs | 100.00 | 100.00 | 100.00 | # ------------------------------------------------------------------------------ -# all files | 55.38 | 100.00 | 0.00 | +# all files | 60.81 | 100.00 | 0.00 | # ------------------------------------------------------------------------------ # end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.js b/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.js deleted file mode 100644 index c59d5af5c36014..00000000000000 --- a/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.js +++ /dev/null @@ -1,9 +0,0 @@ -// Flags: --experimental-test-coverage -import * as a from '../coverage-snap/b.mjs'; -import * as b from '../coverage-snap/a.mjs'; -import * as c from '../coverage-snap/many-uncovered-lines.mjs'; -import { test } from 'node:test'; - -process.stdout.columns = Infinity; - -test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.mjs b/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.mjs new file mode 100644 index 00000000000000..e5ceb8d5ea7a20 --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.mjs @@ -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/many-uncovered-lines.js'; + +import { test } from 'node:test'; + +process.stdout.columns = Infinity; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); diff --git a/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.snapshot b/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.snapshot index b63bfd96bdbb0d..c973983e9c2c19 100644 --- a/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.snapshot +++ b/test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.snapshot @@ -14,14 +14,14 @@ ok 1 - Coverage Print Fixed Width Infinity # todo 0 # duration_ms * # start of coverage report -# ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -# file | line % | branch % | funcs % | uncovered lines -# ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -# test/fixtures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 -# test/fixtures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 -# test/fixtures/test-runner/coverage-snap/many-uncovered-lines.mjs | 59.11 | 42.86 | 3.23 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 52-54 56-58 60-62 64-66 88-90 93-95 97-99 101-103 108-109 115-116 119-120 124-126 129-133 141-143 147 163-164 170 177 185-186 193-197 204-210 213-215 218-220 223-225 -# test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.js | 100.00 | 100.00 | 100.00 | -# ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -# all files | 58.42 | 60.00 | 2.44 | -# ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +# ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +# file | line % | branch % | funcs % | uncovered lines +# ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +# test/fixtures/test-runner/coverage-snap/a.js | 55.77 | 100.00 | 0.00 | 5-7 9-11 13-15 17-19 29-30 40-42 45-47 50-52 +# test/fixtures/test-runner/coverage-snap/b.js | 45.45 | 100.00 | 0.00 | 5-7 9-11 +# test/fixtures/test-runner/coverage-snap/many-uncovered-lines.js | 50.99 | 42.86 | 1.92 | 5-7 9-11 13-15 17-19 29-30 40-42 45-47 50-52 55-57 59-61 63-65 67-69 91-93 96-98 100-102 104-106 111-112 118-119 122-123 127-129 132-136 144-146 150 166-167 173 180 188-189 196-200 207-213 216-218 221-223 226-228 232 236-238 241-243 246-248 251-257 260-262 265-268 271-273 276-280 283-285 288-290 293-295 298-301 304-306 309-312 315-318 321-324 327-329 332-340 343-348 351-353 +# test/fixtures/test-runner/output/coverage-width-infinity-uncovered-lines.mjs | 100.00 | 100.00 | 100.00 | +# ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +# all files | 52.80 | 60.00 | 1.61 | +# ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ # end of coverage report diff --git a/test/fixtures/test-runner/output/coverage-width-infinity.js b/test/fixtures/test-runner/output/coverage-width-infinity.js deleted file mode 100644 index 25b32066097d57..00000000000000 --- a/test/fixtures/test-runner/output/coverage-width-infinity.js +++ /dev/null @@ -1,8 +0,0 @@ -// Flags: --experimental-test-coverage -import * as a from '../coverage-snap/b.mjs'; -import * as b from '../coverage-snap/a.mjs'; -import { test } from 'node:test'; - -process.stdout.columns = Infinity; - -test(`Coverage Print Fixed Width ${process.stdout.columns}`); \ No newline at end of file diff --git a/test/fixtures/test-runner/output/coverage-width-infinity.mjs b/test/fixtures/test-runner/output/coverage-width-infinity.mjs new file mode 100644 index 00000000000000..a71a7aa39f36cb --- /dev/null +++ b/test/fixtures/test-runner/output/coverage-width-infinity.mjs @@ -0,0 +1,11 @@ +// 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 { test } from 'node:test'; + +process.stdout.columns = Infinity; + +test(`Coverage Print Fixed Width ${process.stdout.columns}`); diff --git a/test/fixtures/test-runner/output/coverage-width-infinity.snapshot b/test/fixtures/test-runner/output/coverage-width-infinity.snapshot index 20a54f93874fde..e2d0370cfe41fe 100644 --- a/test/fixtures/test-runner/output/coverage-width-infinity.snapshot +++ b/test/fixtures/test-runner/output/coverage-width-infinity.snapshot @@ -14,13 +14,13 @@ ok 1 - Coverage Print Fixed Width Infinity # todo 0 # duration_ms * # start of coverage report -# ---------------------------------------------------------------------------------------------------------------------------------------- -# file | line % | branch % | funcs % | uncovered lines -# ---------------------------------------------------------------------------------------------------------------------------------------- -# test/fixtures/test-runner/coverage-snap/a.mjs | 53.06 | 100.00 | 0.00 | 2-4 6-8 10-12 14-16 26-27 37-39 42-44 47-49 -# test/fixtures/test-runner/coverage-snap/b.mjs | 25.00 | 100.00 | 0.00 | 2-4 6-8 -# test/fixtures/test-runner/output/coverage-width-infinity.js | 100.00 | 100.00 | 100.00 | -# ---------------------------------------------------------------------------------------------------------------------------------------- -# all files | 55.38 | 100.00 | 0.00 | -# ---------------------------------------------------------------------------------------------------------------------------------------- +# ------------------------------------------------------------------------------------------------------------------------------------------ +# file | line % | branch % | funcs % | uncovered lines +# ------------------------------------------------------------------------------------------------------------------------------------------ +# test/fixtures/test-runner/coverage-snap/a.js | 55.77 | 100.00 | 0.00 | 5-7 9-11 13-15 17-19 29-30 40-42 45-47 50-52 +# test/fixtures/test-runner/coverage-snap/b.js | 45.45 | 100.00 | 0.00 | 5-7 9-11 +# test/fixtures/test-runner/output/coverage-width-infinity.mjs | 100.00 | 100.00 | 100.00 | +# ------------------------------------------------------------------------------------------------------------------------------------------ +# all files | 60.81 | 100.00 | 0.00 | +# ------------------------------------------------------------------------------------------------------------------------------------------ # end of coverage report diff --git a/test/parallel/test-runner-output.mjs b/test/parallel/test-runner-output.mjs index 95ed7f3bf62df8..47e0f211f34a0d 100644 --- a/test/parallel/test-runner-output.mjs +++ b/test/parallel/test-runner-output.mjs @@ -151,14 +151,14 @@ const tests = [ { name: 'test-runner/output/test-runner-plan.js' }, process.features.inspector ? { name: 'test-runner/output/coverage_failure.js' } : false, { name: 'test-runner/output/test-diagnostic-warning-without-test-only-flag.js' }, - process.features.inspector ? { name: 'test-runner/output/coverage-width-80.js' } : false, - process.features.inspector ? { name: 'test-runner/output/coverage-width-100.js' } : false, - process.features.inspector ? { name: 'test-runner/output/coverage-width-150.js' } : false, - process.features.inspector ? { name: 'test-runner/output/coverage-width-infinity.js' } : false, - process.features.inspector ? { name: 'test-runner/output/coverage-width-80-uncovered-lines.js' } : false, - process.features.inspector ? { name: 'test-runner/output/coverage-width-100-uncovered-lines.js' } : false, - process.features.inspector ? { name: 'test-runner/output/coverage-width-150-uncovered-lines.js' } : false, - process.features.inspector ? { name: 'test-runner/output/coverage-width-infinity-uncovered-lines.js' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-80.mjs' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-100.mjs' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-150.mjs' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-infinity.mjs' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-80-uncovered-lines.mjs' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-100-uncovered-lines.mjs' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-150-uncovered-lines.mjs' } : false, + process.features.inspector ? { name: 'test-runner/output/coverage-width-infinity-uncovered-lines.mjs' } : false, ] .filter(Boolean) .map(({ name, tty, transform }) => ({