Skip to content

Commit

Permalink
test: strip color chars in test-runner-run
Browse files Browse the repository at this point in the history
  • Loading branch information
puskin94 committed Aug 27, 2024
1 parent 1399d4e commit 09dd583
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/parallel/test-runner-run.mjs
Original file line number Diff line number Diff line change
@@ -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');

Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit 09dd583

Please sign in to comment.