@@ -47,7 +47,7 @@ test('applies config ignore patterns outside the config root', async () => {
4747 } ) ;
4848} ) ;
4949
50- test ( 'uses Yuku parsers by default and accepts an explicit parser' , async ( ) => {
50+ test ( 'defers parser inference to workers and preserves an explicit parser' , async ( ) => {
5151 await withTempProject ( async ( rootPath ) => {
5252 writeProjectFile ( rootPath , 'index.js' ) ;
5353 writeProjectFile ( rootPath , 'index.ts' ) ;
@@ -57,8 +57,13 @@ test('uses Yuku parsers by default and accepts an explicit parser', async () =>
5757 const inferredFiles = await discover ( rootPath ) ;
5858 const configuredFiles = await discover ( rootPath , [ 'source.custom' ] , { parser : 'babel' } ) ;
5959
60- expect ( relativePaths ( rootPath , inferredFiles ) ) . toEqual ( [ 'index.js' , 'index.ts' ] ) ;
61- expect ( inferredFiles . map ( ( file ) => file . options . parser ) ) . toEqual ( [ 'yuku' , 'yuku-ts' ] ) ;
60+ expect ( relativePaths ( rootPath , inferredFiles ) ) . toEqual ( [
61+ 'index.js' ,
62+ 'index.ts' ,
63+ 'source.custom' ,
64+ 'unknown.extension' ,
65+ ] ) ;
66+ expect ( inferredFiles . every ( ( file ) => file . options . parser === undefined ) ) . toBe ( true ) ;
6267 expect ( configuredFiles [ 0 ] . options ) . toMatchObject ( {
6368 filepath : path . join ( rootPath , 'source.custom' ) ,
6469 parser : 'babel' ,
@@ -108,13 +113,11 @@ test('resolves plugins after applying matching overrides', async () => {
108113 expect ( files ) . toHaveLength ( 2 ) ;
109114 expect ( files [ 0 ] ) . toMatchObject ( {
110115 options : {
111- parser : 'json' ,
112116 plugins : [ pathToFileURL ( pluginEntry ) . href ] ,
113117 } ,
114118 } ) ;
115119 expect ( files [ 1 ] ) . toMatchObject ( {
116120 options : {
117- parser : 'babel' ,
118121 plugins : [ pathToFileURL ( pluginEntry ) . href ] ,
119122 } ,
120123 } ) ;
0 commit comments