Skip to content

Commit 7d26e13

Browse files
committed
fix: reset dom between tests
1 parent b1c2710 commit 7d26e13

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/runtime/__tests__/load-remote.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,14 @@ describe('lazy loadRemote and add remote into snapshot', () => {
535535
});
536536

537537
describe('loadRemote', () => {
538+
beforeEach(() => {
539+
document.querySelectorAll('script').forEach((script) => {
540+
script.remove();
541+
});
542+
document.querySelectorAll('link').forEach((link) => {
543+
link.remove();
544+
});
545+
});
538546
it('loads remote synchronously', async () => {
539547
const jsSyncAssetPath = 'resources/load-remote/app2/say.sync.js';
540548
const remotePublicPath = 'http://localhost:1111/';

0 commit comments

Comments
 (0)