File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
lib/buildtools/src/build/modules/__tests__ Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -125,15 +125,16 @@ test('build manifest', async () => {
125125 await buildManifest ( sampleManifests , outDir ) ;
126126
127127 expect ( fs . mkdir ) . toHaveBeenCalledExactlyOnceWith ( outDir ) ;
128- expect ( fs . writeFile ) . toHaveBeenCalledExactlyOnceWith (
129- `${ outDir } /modules.json` ,
130- JSON . stringify ( {
131- bundle0 : {
132- requires : 1
133- } ,
134- bundle1 : {
135- version : '1.0.0'
136- }
137- } )
138- ) ;
128+ expect ( fs . writeFile ) . toHaveBeenCalledOnce ( ) ;
129+ const [ [ path , output ] ] = vi . mocked ( fs . writeFile ) . mock . calls ;
130+
131+ expect ( path ) . toEqual ( `${ outDir } /modules.json` ) ;
132+ expect ( JSON . parse ( output as string ) ) . toMatchObject ( {
133+ bundle0 : {
134+ requires : 1
135+ } ,
136+ bundle1 : {
137+ version : '1.0.0'
138+ }
139+ } ) ;
139140} ) ;
You can’t perform that action at this time.
0 commit comments