From 09dd58319e84d26d6053f1ba5a4a739257c767fa Mon Sep 17 00:00:00 2001 From: Giovanni Date: Sun, 25 Aug 2024 16:47:25 +0200 Subject: [PATCH] test: strip color chars in `test-runner-run` Fixes: https://github.com/nodejs/node/issues/54551 --- test/parallel/test-runner-run.mjs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-runner-run.mjs b/test/parallel/test-runner-run.mjs index 7a575da9c95275e..170eaa2e1431b28 100644 --- a/test/parallel/test-runner-run.mjs +++ b/test/parallel/test-runner-run.mjs @@ -1,9 +1,12 @@ +// Flags: --expose-internals + import * as common from '../common/index.mjs'; import * as fixtures from '../common/fixtures.mjs'; import { join } from 'node:path'; import { describe, it, run } from 'node:test'; import { dot, spec, tap } from 'node:test/reporters'; import assert from 'node:assert'; +import utils from 'internal/util/inspect'; const testFixtures = fixtures.path('test-runner'); @@ -68,10 +71,9 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { const result = await run({ files: [join(testFixtures, 'default-behavior/test/random.cjs')] }).compose(dot).toArray(); - assert.deepStrictEqual(result, [ - '.', - '\n', - ]); + + assert.strictEqual(utils.stripVTControlCharacters(result[0]), '.'); + assert.strictEqual(utils.stripVTControlCharacters(result[1]), '\n'); }); describe('should be piped with spec reporter', () => {