Skip to content

Commit 82dab76

Browse files
authored
test: fix tests when Amaro is unavailable
Fix two tests that fail when `node` is configured `--without-amaro`. PR-URL: #55320 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 9f9069d commit 82dab76

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

test/es-module/test-esm-loader-entry-url.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('--entry-url', { concurrency: true }, () => {
7676
);
7777
});
7878

79-
it('should support loading TypeScript URLs', async () => {
79+
it('should support loading TypeScript URLs', { skip: !process.config.variables.node_use_amaro }, async () => {
8080
const typescriptUrls = [
8181
'typescript/cts/test-require-ts-file.cts',
8282
'typescript/mts/test-import-ts-file.mts',

test/parallel/test-runner-cli.js

+16-11
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,22 @@ for (const isolation of ['none', 'process']) {
6767
`--experimental-${type}-types`, `--experimental-test-isolation=${isolation}`];
6868
const child = spawnSync(process.execPath, args, { cwd: join(testFixtures, 'matching-patterns') });
6969

70-
assert.strictEqual(child.stderr.toString(), '');
71-
const stdout = child.stdout.toString();
72-
73-
assert.match(stdout, /ok 1 - this should pass/);
74-
assert.match(stdout, /ok 2 - this should pass/);
75-
assert.match(stdout, /ok 3 - this should pass/);
76-
assert.match(stdout, /ok 4 - this should pass/);
77-
assert.match(stdout, /ok 5 - this should pass/);
78-
assert.match(stdout, /ok 6 - this should pass/);
79-
assert.strictEqual(child.status, 0);
80-
assert.strictEqual(child.signal, null);
70+
if (!process.config.variables.node_use_amaro) {
71+
// e.g. Compiled with `--without-amaro`.
72+
assert.strictEqual(child.status, 1);
73+
} else {
74+
assert.strictEqual(child.stderr.toString(), '');
75+
const stdout = child.stdout.toString();
76+
77+
assert.match(stdout, /ok 1 - this should pass/);
78+
assert.match(stdout, /ok 2 - this should pass/);
79+
assert.match(stdout, /ok 3 - this should pass/);
80+
assert.match(stdout, /ok 4 - this should pass/);
81+
assert.match(stdout, /ok 5 - this should pass/);
82+
assert.match(stdout, /ok 6 - this should pass/);
83+
assert.strictEqual(child.status, 0);
84+
assert.strictEqual(child.signal, null);
85+
}
8186
}
8287

8388
{

0 commit comments

Comments
 (0)