@@ -42,10 +42,10 @@ describe('fetcher', () => {
4242 { virtual : true } ,
4343 ) ;
4444
45- const { filePath , config } = await fetchConfig ( mockBasePath ) ;
45+ const configMeta = await fetchConfig ( mockBasePath ) ;
4646
47- expect ( config ) . toEqual ( mockConfig ) ;
48- expect ( filePath ) . toEqual ( mockFilePath ) ;
47+ expect ( configMeta ! . config ) . toEqual ( mockConfig ) ;
48+ expect ( configMeta ! . filePath ) . toEqual ( mockFilePath ) ;
4949 } ) ;
5050
5151 it ( 'fetches config with named export' , async ( ) => {
@@ -57,10 +57,12 @@ describe('fetcher', () => {
5757 } ,
5858 ) ;
5959
60- const { filePath , config } = await fetchConfig ( mockBasePath ) ;
60+ const configMeta = await fetchConfig ( mockBasePath ) ;
6161
62- expect ( config ) . toEqual ( mockConfig ) ;
63- expect ( filePath ) . toEqual ( path . join ( mockBasePath , 'hypermod.config.js' ) ) ;
62+ expect ( configMeta ! . config ) . toEqual ( mockConfig ) ;
63+ expect ( configMeta ! . filePath ) . toEqual (
64+ path . join ( mockBasePath , 'hypermod.config.js' ) ,
65+ ) ;
6466 } ) ;
6567
6668 it ( 'fetches first matched config when multiple are found' , async ( ) => {
@@ -81,10 +83,10 @@ describe('fetcher', () => {
8183 path . join ( mockBasePath , 'codemods' , 'hypermod.config.tsx' ) ,
8284 ] ;
8385
84- const { config , filePath } = await fetchConfig ( mockBasePath ) ;
86+ const configMeta = await fetchConfig ( mockBasePath ) ;
8587
86- expect ( config ) . toEqual ( mockConfig ) ;
87- expect ( filePath ) . toEqual (
88+ expect ( configMeta ! . config ) . toEqual ( mockConfig ) ;
89+ expect ( configMeta ! . filePath ) . toEqual (
8890 path . join ( mockBasePath , 'src' , 'hypermod.config.ts' ) ,
8991 ) ;
9092 } ) ;
@@ -107,13 +109,13 @@ describe('fetcher', () => {
107109 require : jest . fn ( ) . mockReturnValue ( mockConfig ) ,
108110 } ;
109111
110- const { filePath , config } = await fetchPackage (
112+ const configMeta = await fetchPackage (
111113 'fake-package' ,
112114 mockPackageManager as unknown as PluginManager ,
113115 ) ;
114116
115- expect ( config ) . toEqual ( mockConfig ) ;
116- expect ( filePath ) . toEqual ( mockFilePath ) ;
117+ expect ( configMeta ! . config ) . toEqual ( mockConfig ) ;
118+ expect ( configMeta ! . filePath ) . toEqual ( mockFilePath ) ;
117119 } ) ;
118120
119121 it ( 'should throw if fetching fails' , async ( ) => {
@@ -146,13 +148,15 @@ describe('fetcher', () => {
146148 } ) ,
147149 } ;
148150
149- const { config , filePath } = await fetchRemotePackage (
151+ const configMeta = await fetchRemotePackage (
150152 'fake-package' ,
151153 mockPackageManager as unknown as PluginManager ,
152154 ) ;
153155
154- expect ( config ) . toEqual ( mockConfig ) ;
155- expect ( filePath ) . toEqual ( mockBasePath + '/hypermod.config.js' ) ;
156+ expect ( configMeta ! . config ) . toEqual ( mockConfig ) ;
157+ expect ( configMeta ! . filePath ) . toEqual (
158+ mockBasePath + '/hypermod.config.js' ,
159+ ) ;
156160 } ) ;
157161
158162 it ( 'should throw if fetching fails' , async ( ) => {
@@ -179,13 +183,13 @@ describe('fetcher', () => {
179183 } ) ,
180184 } ;
181185
182- const { config , filePath } = await fetchRemotePackage (
186+ const configMeta = await fetchRemotePackage (
183187 'fake-package' ,
184188 mockPackageManager as unknown as PluginManager ,
185189 ) ;
186190
187- expect ( config ) . toEqual ( mockConfig ) ;
188- expect ( filePath ) . toEqual ( mockBasePath + '/index.js' ) ;
191+ expect ( configMeta ! . config ) . toEqual ( mockConfig ) ;
192+ expect ( configMeta ! . filePath ) . toEqual ( mockBasePath + '/index.js' ) ;
189193 } ) ;
190194
191195 it ( 'throws if entrypoint-based config does not contain a valid config (and there are no config files available elsewhere)' , async ( ) => {
0 commit comments