Skip to content

Commit 9333d0c

Browse files
committed
test: split test-runner-output
1 parent aee022c commit 9333d0c

File tree

72 files changed

+978
-278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+978
-278
lines changed

test/parallel/test-runner-output.mjs

Lines changed: 0 additions & 278 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/abort_hooks.js matches test-runner/output/abort_hooks.snapshot
3+
import '../common/index.mjs';
4+
import * as fixtures from '../common/fixtures.mjs';
5+
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
6+
7+
ensureCwdIsProjectRoot();
8+
await spawnAndAssert(
9+
fixtures.path('test-runner/output/abort_hooks.js'),
10+
defaultTransform,
11+
{ flags: ['--test-reporter=tap'] },
12+
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/abort-runs-after-hook.js matches
3+
// test-runner/output/abort-runs-after-hook.snapshot
4+
import '../common/index.mjs';
5+
import * as fixtures from '../common/fixtures.mjs';
6+
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
7+
8+
ensureCwdIsProjectRoot();
9+
await spawnAndAssert(
10+
fixtures.path('test-runner/output/abort-runs-after-hook.js'),
11+
defaultTransform,
12+
{ flags: ['--test-reporter=tap'] },
13+
);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/abort_suite.js matches test-runner/output/abort_suite.snapshot
3+
import '../common/index.mjs';
4+
import * as fixtures from '../common/fixtures.mjs';
5+
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
6+
7+
ensureCwdIsProjectRoot();
8+
await spawnAndAssert(
9+
fixtures.path('test-runner/output/abort_suite.js'),
10+
defaultTransform,
11+
{ flags: ['--test-reporter=tap'] },
12+
);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/abort.js matches test-runner/output/abort.snapshot
3+
import '../common/index.mjs';
4+
import * as fixtures from '../common/fixtures.mjs';
5+
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
6+
7+
ensureCwdIsProjectRoot();
8+
await spawnAndAssert(
9+
fixtures.path('test-runner/output/abort.js'),
10+
defaultTransform,
11+
{ flags: ['--test-reporter=tap'] },
12+
);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/arbitrary-output-colored.js matches
3+
// test-runner/output/arbitrary-output-colored.snapshot
4+
import * as common from '../common/index.mjs';
5+
import * as fixtures from '../common/fixtures.mjs';
6+
import { spawnAndAssert, specTransform, replaceTestDuration, transform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
7+
8+
const skipForceColors =
9+
process.config.variables.icu_gyp_path !== 'tools/icu/icu-generic.gyp' ||
10+
process.config.variables.node_shared_openssl;
11+
12+
if (skipForceColors) {
13+
common.skip('ICU or OpenSSL is not compatible with FORCE_COLOR');
14+
}
15+
16+
ensureCwdIsProjectRoot();
17+
await spawnAndAssert(
18+
fixtures.path('test-runner/output/arbitrary-output-colored.js'),
19+
transform(specTransform, replaceTestDuration),
20+
{ tty: true },
21+
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/arbitrary-output.js matches
3+
// test-runner/output/arbitrary-output.snapshot
4+
import '../common/index.mjs';
5+
import * as fixtures from '../common/fixtures.mjs';
6+
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
7+
8+
ensureCwdIsProjectRoot();
9+
await spawnAndAssert(
10+
fixtures.path('test-runner/output/arbitrary-output.js'),
11+
defaultTransform,
12+
{ flags: ['--test-reporter=tap'] },
13+
);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/assertion-color-tty.mjs matches
3+
// test-runner/output/assertion-color-tty.snapshot
4+
import * as common from '../common/index.mjs';
5+
import * as fixtures from '../common/fixtures.mjs';
6+
import { spawnAndAssert, specTransform, canColorize, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
7+
8+
if (!canColorize()) {
9+
common.skip('TTY colors not supported');
10+
}
11+
12+
ensureCwdIsProjectRoot();
13+
await spawnAndAssert(
14+
fixtures.path('test-runner/output/assertion-color-tty.mjs'),
15+
specTransform,
16+
{ flags: ['--test', '--stack-trace-limit=0'], tty: true },
17+
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/async-test-scheduling.mjs matches
3+
// test-runner/output/async-test-scheduling.snapshot
4+
import '../common/index.mjs';
5+
import * as fixtures from '../common/fixtures.mjs';
6+
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
7+
8+
ensureCwdIsProjectRoot();
9+
await spawnAndAssert(
10+
fixtures.path('test-runner/output/async-test-scheduling.mjs'),
11+
defaultTransform,
12+
{ flags: ['--test-reporter=tap'] },
13+
);

0 commit comments

Comments
 (0)