Skip to content

Commit ccd5ec0

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

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
@@ -679,8 +679,7 @@ describe('namespace-scoped options', () => {
679679
describe('JSON Schema validation', () => {
680680
test('rejects boolean option with string value', async () => {
681681
const result = await spawnPromisified(process.execPath, [
682-
'--experimental-config-file',
683-
fixtures.path('rc/invalid-schema-type.json'),
682+
`--experimental-config-file=${fixtures.path('rc/invalid-schema-type.json')}`,
684683
'-p', '"Hello"',
685684
]);
686685
assert.match(result.stderr, /Invalid configuration/);
@@ -690,8 +689,7 @@ describe('JSON Schema validation', () => {
690689

691690
test('rejects number option with string value', async () => {
692691
const result = await spawnPromisified(process.execPath, [
693-
'--experimental-config-file',
694-
fixtures.path('rc/invalid-schema-number-as-string.json'),
692+
`--experimental-config-file=${fixtures.path('rc/invalid-schema-number-as-string.json')}`,
695693
'-p', '"Hello"',
696694
]);
697695
assert.match(result.stderr, /Invalid configuration/);
@@ -701,8 +699,7 @@ describe('JSON Schema validation', () => {
701699

702700
test('rejects array option with boolean value', async () => {
703701
const result = await spawnPromisified(process.execPath, [
704-
'--experimental-config-file',
705-
fixtures.path('rc/invalid-schema-array-as-bool.json'),
702+
`--experimental-config-file=${fixtures.path('rc/invalid-schema-array-as-bool.json')}`,
706703
'-p', '"Hello"',
707704
]);
708705
assert.match(result.stderr, /Invalid configuration/);
@@ -712,8 +709,7 @@ describe('JSON Schema validation', () => {
712709

713710
test('rejects array with wrong item type', async () => {
714711
const result = await spawnPromisified(process.execPath, [
715-
'--experimental-config-file',
716-
fixtures.path('rc/invalid-schema-nested-type.json'),
712+
`--experimental-config-file=${fixtures.path('rc/invalid-schema-nested-type.json')}`,
717713
'-p', '"Hello"',
718714
]);
719715
assert.match(result.stderr, /Invalid configuration/);
@@ -723,8 +719,7 @@ describe('JSON Schema validation', () => {
723719

724720
test('reports every error when multiple properties fail', async () => {
725721
const result = await spawnPromisified(process.execPath, [
726-
'--experimental-config-file',
727-
fixtures.path('rc/invalid-schema-multiple-errors.json'),
722+
`--experimental-config-file=${fixtures.path('rc/invalid-schema-multiple-errors.json')}`,
728723
'-p', '"Hello"',
729724
]);
730725
assert.match(result.stderr, /Invalid configuration/);
@@ -735,17 +730,15 @@ describe('JSON Schema validation', () => {
735730

736731
test('accepts valid config with mixed types', async () => {
737732
const result = await spawnPromisified(process.execPath, [
738-
'--experimental-config-file',
739-
fixtures.path('rc/valid-schema-all-types.json'),
733+
`--experimental-config-file=${fixtures.path('rc/valid-schema-all-types.json')}`,
740734
'-e', 'process.exit(0)',
741735
]);
742736
assert.strictEqual(result.code, 0);
743737
});
744738

745739
test('accepts empty object config', async () => {
746740
const result = await spawnPromisified(process.execPath, [
747-
'--experimental-config-file',
748-
fixtures.path('rc/empty-object.json'),
741+
`--experimental-config-file=${fixtures.path('rc/empty-object.json')}`,
749742
'-e', 'process.exit(0)',
750743
]);
751744
assert.strictEqual(result.code, 0);

0 commit comments

Comments
 (0)