Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion e2e/cases/sri/enable-dev/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { dev, rspackOnlyTest } from '@e2e/helper';
import { dev, proxyConsole, rspackOnlyTest } from '@e2e/helper';
import { expect } from '@playwright/test';

rspackOnlyTest(
'generate integrity for script and style tags in dev build',
async ({ page }) => {
const { logs, restore } = proxyConsole();

const rsbuild = await dev({
cwd: __dirname,
page,
Expand All @@ -19,5 +21,15 @@ rspackOnlyTest(
).toMatch(/sha384-[A-Za-z0-9+\/=]+/);

await rsbuild.close();

expect(
logs.some((log) =>
log.includes(
'SubResourceIntegrityPlugin may interfere with hot reloading',
),
),
).toBe(true);

restore();
Copy link

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider wrapping the test assertions and restore() in a try...finally block to ensure that restore() is always called, even if an assertion fails.

Copilot uses AI. Check for mistakes.
},
);
Loading