mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: fix tests when Amaro is unavailable
Fix two tests that fail when `node` is configured `--without-amaro`. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
9f9069d313
commit
82dab76d63
@ -76,7 +76,7 @@ describe('--entry-url', { concurrency: true }, () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('should support loading TypeScript URLs', async () => {
|
||||
it('should support loading TypeScript URLs', { skip: !process.config.variables.node_use_amaro }, async () => {
|
||||
const typescriptUrls = [
|
||||
'typescript/cts/test-require-ts-file.cts',
|
||||
'typescript/mts/test-import-ts-file.mts',
|
||||
|
@ -67,17 +67,22 @@ for (const isolation of ['none', 'process']) {
|
||||
`--experimental-${type}-types`, `--experimental-test-isolation=${isolation}`];
|
||||
const child = spawnSync(process.execPath, args, { cwd: join(testFixtures, 'matching-patterns') });
|
||||
|
||||
assert.strictEqual(child.stderr.toString(), '');
|
||||
const stdout = child.stdout.toString();
|
||||
if (!process.config.variables.node_use_amaro) {
|
||||
// e.g. Compiled with `--without-amaro`.
|
||||
assert.strictEqual(child.status, 1);
|
||||
} else {
|
||||
assert.strictEqual(child.stderr.toString(), '');
|
||||
const stdout = child.stdout.toString();
|
||||
|
||||
assert.match(stdout, /ok 1 - this should pass/);
|
||||
assert.match(stdout, /ok 2 - this should pass/);
|
||||
assert.match(stdout, /ok 3 - this should pass/);
|
||||
assert.match(stdout, /ok 4 - this should pass/);
|
||||
assert.match(stdout, /ok 5 - this should pass/);
|
||||
assert.match(stdout, /ok 6 - this should pass/);
|
||||
assert.strictEqual(child.status, 0);
|
||||
assert.strictEqual(child.signal, null);
|
||||
assert.match(stdout, /ok 1 - this should pass/);
|
||||
assert.match(stdout, /ok 2 - this should pass/);
|
||||
assert.match(stdout, /ok 3 - this should pass/);
|
||||
assert.match(stdout, /ok 4 - this should pass/);
|
||||
assert.match(stdout, /ok 5 - this should pass/);
|
||||
assert.match(stdout, /ok 6 - this should pass/);
|
||||
assert.strictEqual(child.status, 0);
|
||||
assert.strictEqual(child.signal, null);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user