File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
tests/e2e/cases/hooks/asset-emitted Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ test('asset emitted hook should only emit modified assets', async ({
1515 return content . replace ( '__ROOT_TEXT__' , '__OTHER_TEXT__' ) ;
1616 } ) ;
1717 await expect ( page . locator ( '#root' ) ) . toHaveText ( '__OTHER_TEXT____FOO_VALUE__' ) ;
18- expect ( assets ) . toEqual ( [ 'main.js' ] ) ;
18+ expect ( assets . sort ( ) ) . toEqual ( [ 'main.js' , 'main.js.map '] ) ;
1919
2020 // reset assets
2121 assets . length = 0 ;
@@ -26,7 +26,12 @@ test('asset emitted hook should only emit modified assets', async ({
2626 } ) ;
2727 await expect ( page . locator ( '#root' ) ) . toHaveText ( '__OTHER_TEXT____VALUE__' ) ;
2828 // main.js contains runtime module, so it should also emit
29- expect ( assets . sort ( ) ) . toEqual ( [ 'main.js' , 'src_foo_js.js' ] ) ;
29+ expect ( assets . sort ( ) ) . toEqual ( [
30+ 'main.js' ,
31+ 'main.js.map' ,
32+ 'src_foo_js.js' ,
33+ 'src_foo_js.js.map' ,
34+ ] ) ;
3035
3136 // check dist dir
3237 // the outputFileSystem can contain only one main hot-update.js
@@ -53,7 +58,7 @@ test('asset emitted should not emit removed assets', async ({
5358 return 'document.getElementById("root").innerText = "__ROOT_TEXT__"' ;
5459 } ) ;
5560 await expect ( page . locator ( '#root' ) ) . toHaveText ( '__ROOT_TEXT__' ) ;
56- expect ( assets ) . toEqual ( [ 'main.js' ] ) ;
61+ expect ( assets . sort ( ) ) . toEqual ( [ 'main.js' , 'main.js.map '] ) ;
5762
5863 // check dist dir
5964 const files = rspack . compiler . outputFileSystem . readdirSync (
You can’t perform that action at this time.
0 commit comments