Skip to content
Next Next commit
test: skip failing tests when compiled without amaro
When compiled without amaro, this conflicts with
--experimental-strip-types defaulting to true. To avoid that,
we need to skip relevant failing tests.

Fixes: #60640
  • Loading branch information
y-okt committed Nov 28, 2025
commit c21b6c7919d2fa845205c9345249e25e4cb8f05b
7 changes: 6 additions & 1 deletion test/es-module/test-esm-detect-ambiguous.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { spawnPromisified } from '../common/index.mjs';
import * as common from '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import { spawn } from 'node:child_process';
import { describe, it } from 'node:test';
import assert from 'node:assert';

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}
const { spawnPromisified } = common;

describe('Module syntax detection', { concurrency: !process.env.TEST_PARALLEL }, () => {
describe('string input', { concurrency: !process.env.TEST_PARALLEL }, () => {
it('permits ESM syntax in --eval input without requiring --input-type=module', async () => {
Expand Down
7 changes: 6 additions & 1 deletion test/es-module/test-esm-import-meta-main-eval.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { spawnPromisified } from '../common/index.mjs';
import * as common from '../common/index.mjs';
import * as fixtures from '../common/fixtures.js';
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}
const { spawnPromisified } = common;

function wrapScriptInEvalWorker(script) {
return `
import { Worker } from 'node:worker_threads';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { spawnPromisified } from '../common/index.mjs';
import * as common from '../common/index.mjs';
import { describe, it } from 'node:test';
import assert from 'node:assert';

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}
const { spawnPromisified } = common;

describe('unusual top-level await syntax errors', () => {
const expressions = [
// string
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-compile-cache-typescript-commonjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

// This tests NODE_COMPILE_CACHE works for CommonJS with types.

require('../common');
const common = require('../common');
const { spawnSyncAndAssert } = require('../common/child_process');
const assert = require('assert');
const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

// Check cache for .ts files that would be run as CommonJS.
{
tmpdir.refresh();
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-compile-cache-typescript-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

// This tests NODE_COMPILE_CACHE works for ESM with types.

require('../common');
const common = require('../common');
const { spawnSyncAndAssert } = require('../common/child_process');
const assert = require('assert');
const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

// Check cache for .ts files that would be run as ESM.
{
tmpdir.refresh();
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-compile-cache-typescript-strip-miss.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
// This tests NODE_COMPILE_CACHE can handle cache invalidation
// between strip-only TypeScript and transformed TypeScript.

require('../common');
const common = require('../common');
const { spawnSyncAndAssert } = require('../common/child_process');
const assert = require('assert');
const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

tmpdir.refresh();
const dir = tmpdir.resolve('.compile_cache_dir');
const script = fixtures.path('typescript', 'ts', 'test-typescript.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
// This tests NODE_COMPILE_CACHE can be used for type stripping and ignores
// --enable-source-maps as there's no difference in the code generated.

require('../common');
const common = require('../common');
const { spawnSyncAndAssert } = require('../common/child_process');
const assert = require('assert');
const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

tmpdir.refresh();
const dir = tmpdir.resolve('.compile_cache_dir');
const script = fixtures.path('typescript', 'ts', 'test-typescript.ts');
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-compile-cache-typescript-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

// This tests NODE_COMPILE_CACHE works with --experimental-transform-types.

require('../common');
const common = require('../common');
const { spawnSyncAndAssert } = require('../common/child_process');
const assert = require('assert');
const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}


tmpdir.refresh();
const dir = tmpdir.resolve('.compile_cache_dir');
Expand Down
9 changes: 7 additions & 2 deletions test/parallel/test-config-file.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
'use strict';

const common = require('../common');
const {
isWindows,
spawnPromisified,
skipIfSQLiteMissing,
} = require('../common');
skipIfSQLiteMissing();
} = common;
const fixtures = require('../common/fixtures');
const tmpdir = require('../common/tmpdir');
const assert = require('node:assert');
const { test, it, describe } = require('node:test');
const { chmodSync, writeFileSync, constants } = require('node:fs');
const { join } = require('node:path');

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}
skipIfSQLiteMissing();

test('should handle non existing json', async () => {
const result = await spawnPromisified(process.execPath, [
'--experimental-config-file',
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-node-output-eval.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import '../common/index.mjs';
import * as common from '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import * as snapshot from '../common/assertSnapshot.js';
import { basename } from 'node:path';
import { describe, it } from 'node:test';

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

describe('eval output', { concurrency: true }, () => {
function normalize(str) {
return str.replaceAll(snapshot.replaceWindowsPaths(process.cwd()), '')
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-node-output-sourcemaps.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import '../common/index.mjs';
import * as common from '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import * as snapshot from '../common/assertSnapshot.js';
import { describe, it } from 'node:test';

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

describe('sourcemaps output', { concurrency: !process.env.TEST_PARALLEL }, () => {
const defaultTransform = snapshot
.transform(
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-runner-coverage-default-exclusion.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import '../common/index.mjs';
import * as common from '../common/index.mjs';
import { before, describe, it } from 'node:test';
import assert from 'node:assert';
import { spawnSync } from 'node:child_process';
import { cp } from 'node:fs/promises';
import tmpdir from '../common/tmpdir.js';
import fixtures from '../common/fixtures.js';

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}
const skipIfNoInspector = {
skip: !process.features.inspector ? 'inspector disabled' : false
};
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-runner-global-setup-teardown.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../common/index.mjs';
import * as common from '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import { describe, it, beforeEach } from 'node:test';
import assert from 'node:assert';
Expand All @@ -8,6 +8,10 @@ import tmpdir from '../common/tmpdir.js';
import { once } from 'node:events';
import { join } from 'node:path';

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

const testFixtures = fixtures.path('test-runner');

async function runTest(
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-runner-run-global-hooks.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mustCall, mustCallAtLeast } from '../common/index.mjs';
import { mustCall, mustCallAtLeast, skip } from '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import { describe, it, beforeEach, run } from 'node:test';
import assert from 'node:assert';
Expand All @@ -8,6 +8,10 @@ import path from 'node:path';
import { spawn } from 'node:child_process';
import { once } from 'node:events';

if (!process.config.variables.node_use_amaro) {
skip('Requires Amaro');
}

const testFixtures = fixtures.path('test-runner', 'global-setup-teardown');
const runnerFixture = fixtures.path('test-runner', 'test-runner-global-hooks.mjs');

Expand Down
6 changes: 4 additions & 2 deletions test/parallel/test-util-getcallsites.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
'use strict';

const common = require('../common');

const fixtures = require('../common/fixtures');
const file = fixtures.path('get-call-sites.js');

const { getCallSites } = require('node:util');
const { spawnSync } = require('node:child_process');
const assert = require('node:assert');

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

{
const callSites = getCallSites();
assert.ok(callSites.length > 1);
Expand Down
4 changes: 4 additions & 0 deletions test/parallel/test-worker-cli-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ const common = require('../common');
const { Worker } = require('worker_threads');
const assert = require('assert');

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

const CODE = `
// If the --expose-internals flag does not pass to worker
// require function will throw an error
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-worker-eval-typescript.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
'use strict';
require('../common');
const common = require('../common');
const assert = require('assert');
const { Worker } = require('worker_threads');
const { test } = require('node:test');
const { once } = require('events');

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

const esmHelloWorld = `
import worker from 'worker_threads';
const foo: string = 'Hello, World!';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');

const { Worker } = require('worker_threads');

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

(common.mustCall(() => {
new Worker(fixtures.path('worker-script.ts'));
}))();
4 changes: 4 additions & 0 deletions test/parallel/test-worker-syntax-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ const common = require('../common');
const assert = require('assert');
const { Worker } = require('worker_threads');

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

const w = new Worker('abc)', { eval: true });
w.on('message', common.mustNotCall());
w.on('error', common.mustCall((err) => {
Expand Down
4 changes: 4 additions & 0 deletions test/test-runner/test-output-typescript-coverage.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import * as common from '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';

if (!process.config.variables.node_use_amaro) {
common.skip('Requires Amaro');
}

if (!process.features.inspector) {
common.skip('inspector support required');
}
Expand Down