Skip to content

test: Enable skipped colorize test #57887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
ℹ output | [31m [34m | [31m [34m | [31m [34m |
ℹ [32mcoverage-width-80-color.mjs [34m | [32m100.00[34m | [32m 100.00[34m | [32m 100.00[34m |
ℹ ------------------------------------------------------------------------------
ℹ all files | [33m 61.33[34m | [32m 100.00[34m | [31m 0.00[34m |
ℹ all files | [33m 62.34[34m | [32m 100.00[34m | [31m 0.00[34m |
ℹ ------------------------------------------------------------------------------
ℹ end of coverage report
[39m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
ℹ output | [31m [34m | [31m [34m | [31m [34m |
ℹ [32mcoverage-width-80-uncovered-lines-color.mjs [34m | [32m100.00[34m | [32m 100.00[34m | [32m 100.00[34m |
ℹ --------------------------------------------------------------------------------------------------
ℹ all files | [33m 52.91[34m | [33m 60.00[34m | [31m 1.61[34m |
ℹ all files | [33m 53.24[34m | [33m 60.00[34m | [31m 1.61[34m |
ℹ --------------------------------------------------------------------------------------------------
ℹ end of coverage report
[39m
6 changes: 3 additions & 3 deletions test/parallel/test-runner-output.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Flags: --expose-internals
import * as common from '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import * as snapshot from '../common/assertSnapshot.js';
import { describe, it } from 'node:test';
import { hostname } from 'node:os';
import { chdir, cwd } from 'node:process';
import { fileURLToPath } from 'node:url';
import internalTTy from 'internal/tty';

const skipForceColors =
process.config.variables.icu_gyp_path !== 'tools/icu/icu-generic.gyp' ||
process.config.variables.node_shared_openssl;

const canColorize = process.stderr?.isTTY && (
typeof process.stderr?.getColorDepth === 'function' ?
process.stderr?.getColorDepth() > 2 : true);
const canColorize = internalTTy.getColorDepth() > 2;
const skipCoverageColors = !canColorize;

function replaceTestDuration(str) {
Expand Down
Loading