Skip to content

Commit dded04a

Browse files
committed
test: use --experimental-config-file= syntax for schema tests
1 parent d91c997 commit dded04a

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

test/parallel/test-config-file.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,7 @@ describe('namespace-scoped options', () => {
609609
describe('JSON Schema validation', () => {
610610
test('rejects boolean option with string value', async () => {
611611
const result = await spawnPromisified(process.execPath, [
612-
'--experimental-config-file',
613-
fixtures.path('rc/invalid-schema-type.json'),
612+
`--experimental-config-file=${fixtures.path('rc/invalid-schema-type.json')}`,
614613
'-p', '"Hello"',
615614
]);
616615
assert.match(result.stderr, /Invalid configuration/);
@@ -620,8 +619,7 @@ describe('JSON Schema validation', () => {
620619

621620
test('rejects number option with string value', async () => {
622621
const result = await spawnPromisified(process.execPath, [
623-
'--experimental-config-file',
624-
fixtures.path('rc/invalid-schema-number-as-string.json'),
622+
`--experimental-config-file=${fixtures.path('rc/invalid-schema-number-as-string.json')}`,
625623
'-p', '"Hello"',
626624
]);
627625
assert.match(result.stderr, /Invalid configuration/);
@@ -631,8 +629,7 @@ describe('JSON Schema validation', () => {
631629

632630
test('rejects array option with boolean value', async () => {
633631
const result = await spawnPromisified(process.execPath, [
634-
'--experimental-config-file',
635-
fixtures.path('rc/invalid-schema-array-as-bool.json'),
632+
`--experimental-config-file=${fixtures.path('rc/invalid-schema-array-as-bool.json')}`,
636633
'-p', '"Hello"',
637634
]);
638635
assert.match(result.stderr, /Invalid configuration/);
@@ -642,8 +639,7 @@ describe('JSON Schema validation', () => {
642639

643640
test('rejects array with wrong item type', async () => {
644641
const result = await spawnPromisified(process.execPath, [
645-
'--experimental-config-file',
646-
fixtures.path('rc/invalid-schema-nested-type.json'),
642+
`--experimental-config-file=${fixtures.path('rc/invalid-schema-nested-type.json')}`,
647643
'-p', '"Hello"',
648644
]);
649645
assert.match(result.stderr, /Invalid configuration/);
@@ -653,8 +649,7 @@ describe('JSON Schema validation', () => {
653649

654650
test('reports every error when multiple properties fail', async () => {
655651
const result = await spawnPromisified(process.execPath, [
656-
'--experimental-config-file',
657-
fixtures.path('rc/invalid-schema-multiple-errors.json'),
652+
`--experimental-config-file=${fixtures.path('rc/invalid-schema-multiple-errors.json')}`,
658653
'-p', '"Hello"',
659654
]);
660655
assert.match(result.stderr, /Invalid configuration/);
@@ -665,17 +660,15 @@ describe('JSON Schema validation', () => {
665660

666661
test('accepts valid config with mixed types', async () => {
667662
const result = await spawnPromisified(process.execPath, [
668-
'--experimental-config-file',
669-
fixtures.path('rc/valid-schema-all-types.json'),
663+
`--experimental-config-file=${fixtures.path('rc/valid-schema-all-types.json')}`,
670664
'-e', 'process.exit(0)',
671665
]);
672666
assert.strictEqual(result.code, 0);
673667
});
674668

675669
test('accepts empty object config', async () => {
676670
const result = await spawnPromisified(process.execPath, [
677-
'--experimental-config-file',
678-
fixtures.path('rc/empty-object.json'),
671+
`--experimental-config-file=${fixtures.path('rc/empty-object.json')}`,
679672
'-e', 'process.exit(0)',
680673
]);
681674
assert.strictEqual(result.code, 0);

0 commit comments

Comments
 (0)