Skip to content

Commit f6bef7f

Browse files
committed
update test case
1 parent 7e3f4c3 commit f6bef7f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/e2e/cases/hooks/asset-emitted/index.test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)