Skip to content

Commit 332027b

Browse files
committed
test: include passing tests from skip list
some tests are skipped although they aren't relevant to amaro. Fixes: #60815
1 parent 5e30dbf commit 332027b

11 files changed

+11
-29
lines changed

test/es-module/test-esm-detect-ambiguous.mjs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { spawn } from 'node:child_process';
44
import { describe, it } from 'node:test';
55
import assert from 'node:assert';
66

7-
const onlyWithAmaro = { skip: !process.config.variables.node_use_amaro };
8-
97
describe('Module syntax detection', { concurrency: !process.env.TEST_PARALLEL }, () => {
108
describe('string input', { concurrency: !process.env.TEST_PARALLEL }, () => {
119
it('permits ESM syntax in --eval input without requiring --input-type=module', async () => {
@@ -265,9 +263,7 @@ describe('Module syntax detection', { concurrency: !process.env.TEST_PARALLEL },
265263
assert.strictEqual(signal, null);
266264
});
267265

268-
it('still throws on `await` in an ordinary sync function',
269-
onlyWithAmaro,
270-
async () => {
266+
it('still throws on `await` in an ordinary sync function', async () => {
271267
const { stdout, stderr, code, signal } = await spawnPromisified(process.execPath, [
272268
'--eval',
273269
'function fn() { await Promise.resolve(); } fn();',
@@ -318,9 +314,7 @@ describe('Module syntax detection', { concurrency: !process.env.TEST_PARALLEL },
318314
assert.strictEqual(signal, null);
319315
});
320316

321-
it('still throws on double `const` declaration not at the top level',
322-
onlyWithAmaro,
323-
async () => {
317+
it('still throws on double `const` declaration not at the top level', async () => {
324318
const { stdout, stderr, code, signal } = await spawnPromisified(process.execPath, [
325319
'--eval',
326320
'function fn() { const require = 1; const require = 2; } fn();',

test/es-module/test-esm-resolve-type.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ try {
198198
subdirPackageType,
199199
expectedResolvedFormat,
200200
mainSuffix = '' ] = testVariant;
201+
const skip = mainImportScript.endsWith('.ts') && !process.config.variables.node_use_amaro;
202+
if (skip) {
203+
return;
204+
}
201205

202206
const mDir = rel(`node_modules/${moduleName}`);
203207
const subDir = rel(`node_modules/${moduleName}/subdir`);

test/es-module/test-esm-tla-syntax-errors-not-recognized-as-tla-error.mjs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { spawnPromisified } from '../common/index.mjs';
22
import { describe, it } from 'node:test';
33
import assert from 'node:assert';
44

5-
const onlyWithAmaro = { skip: !process.config.variables.node_use_amaro };
6-
75
describe('unusual top-level await syntax errors', () => {
86
const expressions = [
97
// string
@@ -51,9 +49,7 @@ describe('unusual top-level await syntax errors', () => {
5149
}
5250
});
5351

54-
it('should throw the error for unrelated syntax errors',
55-
onlyWithAmaro,
56-
async () => {
52+
it('should throw the error for unrelated syntax errors', async () => {
5753
const expression = 'foo bar';
5854
const wrapperExpressions = [
5955
[`function callSyntaxError() {}; callSyntaxError(${expression});`, /missing \) after argument list/],

test/parallel/test-cli-node-options-docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ for (const [, envVar, config] of nodeOptionsCC.matchAll(addOptionRE)) {
6464
}
6565

6666
// Exception for HAVE_AMARO conditional default (defaults to true when Amaro is available)
67-
if (process.config.variables.node_use_amaro) {
67+
if (config.includes('HAVE_AMARO')) {
6868
hasTrueAsDefaultValue = true;
6969
}
7070

test/parallel/test-compile-cache-typescript-commonjs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const tmpdir = require('../common/tmpdir');
1212
const fixtures = require('../common/fixtures');
1313

1414
// Check cache for .ts files that would be run as CommonJS.
15-
{
15+
if (process.config.variables.node_use_amaro) {
1616
tmpdir.refresh();
1717
const dir = tmpdir.resolve('.compile_cache_dir');
1818
const script = fixtures.path('typescript', 'ts', 'test-commonjs-parsing.ts');

test/parallel/test-compile-cache-typescript-esm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const tmpdir = require('../common/tmpdir');
1212
const fixtures = require('../common/fixtures');
1313

1414
// Check cache for .ts files that would be run as ESM.
15-
{
15+
if (process.config.variables.node_use_amaro) {
1616
tmpdir.refresh();
1717
const dir = tmpdir.resolve('.compile_cache_dir');
1818
const script = fixtures.path('typescript', 'ts', 'test-module-typescript.ts');

test/parallel/test-config-file.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ test('should throw an error when a flag is declared twice', async () => {
8585
assert.strictEqual(result.code, 9);
8686
});
8787

88-
8988
test('should override env-file', onlyWithAmaro, async () => {
9089
const result = await spawnPromisified(process.execPath, [
9190
'--no-warnings',

test/parallel/test-runner-coverage-default-exclusion.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ async function setupFixtures() {
1616
await cp(fixtureDir, tmpdir.path, { recursive: true });
1717
}
1818

19-
const onlyWithAmaro = { skip: !process.config.variables.node_use_amaro };
20-
2119
describe('test runner coverage default exclusion', skipIfNoInspector, () => {
2220
before(async () => {
2321
await setupFixtures();
@@ -88,7 +86,7 @@ describe('test runner coverage default exclusion', skipIfNoInspector, () => {
8886
assert.strictEqual(result.status, 0);
8987
});
9088

91-
it('should exclude ts test files', onlyWithAmaro, async () => {
89+
it('should exclude ts test files', async () => {
9290
const report = [
9391
'# start of coverage report',
9492
'# --------------------------------------------------------------',

test/parallel/test-worker-cli-options.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Flags: --expose-internals --expose-gc
22
'use strict';
33
const common = require('../common');
4-
if (!process.config.variables.node_use_amaro) {
5-
common.skip('Requires Amaro');
6-
}
74
const { Worker } = require('worker_threads');
85
const assert = require('assert');
96

test/parallel/test-worker-load-file-with-extension-other-than-js.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
'use strict';
22
const common = require('../common');
3-
if (!process.config.variables.node_use_amaro) {
4-
common.skip('Requires Amaro');
5-
}
63
const fixtures = require('../common/fixtures');
74
const { Worker } = require('worker_threads');
85

0 commit comments

Comments
 (0)