@@ -516,14 +516,26 @@ describe('namespace-scoped options', () => {
516516 assert . strictEqual ( result . code , 9 ) ;
517517 } ) ;
518518
519- it ( 'should not throw an error when a namespace is not recognised' , async ( ) => {
519+ it ( 'should throw an error when a namespace is not recognised' , async ( ) => {
520520 const result = await spawnPromisified ( process . execPath , [
521521 '--no-warnings' ,
522522 `--experimental-config-file=${ fixtures . path ( 'rc/unknown-namespace.json' ) } ` ,
523523 '-p' , '"Hello, World!"' ,
524524 ] ) ;
525+ assert . match ( result . stderr , / U n k n o w n n a m e s p a c e a n - i n v a l i d - n a m e s p a c e / ) ;
526+ assert . match ( result . stderr , / u n k n o w n - n a m e s p a c e \. j s o n : i n v a l i d c o n t e n t / ) ;
527+ assert . strictEqual ( result . stdout , '' ) ;
528+ assert . strictEqual ( result . code , 9 ) ;
529+ } ) ;
530+
531+ it ( 'should allow the $schema field' , async ( ) => {
532+ const result = await spawnPromisified ( process . execPath , [
533+ '--no-warnings' ,
534+ `--experimental-config-file=${ fixtures . path ( 'rc/schema.json' ) } ` ,
535+ '-p' , 'http.maxHeaderSize' ,
536+ ] ) ;
525537 assert . strictEqual ( result . stderr , '' ) ;
526- assert . strictEqual ( result . stdout , 'Hello, World! \n' ) ;
538+ assert . strictEqual ( result . stdout , '10 \n' ) ;
527539 assert . strictEqual ( result . code , 0 ) ;
528540 } ) ;
529541
0 commit comments