Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Commit 8f5d9a0

Browse files
authored
chore: update tests for compatibility with Vite 6 (#208)
1 parent 59efc9b commit 8f5d9a0

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

playground/hmr/__tests__/hmr.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ test("HMR invalidate", async ({ page }) => {
7474
await waitForLogs(
7575
"[vite] invalidate /src/TitleWithExport.tsx: Could not Fast Refresh (export removed)",
7676
"[vite] hot updated: /src/App.tsx",
77-
"[hmr] Failed to reload /src/App.tsx. This could be due to syntax errors or importing non-existent modules. (see errors above)",
77+
/Failed to reload \/src\/App\.tsx. This could be due to syntax errors or importing non-existent modules\. \(see errors above\)$/,
7878
);
7979

8080
// Remove usage from App

playground/utils.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ export const setupWaitForLogs = async (page: Page) => {
1313
page.on("console", (log) => {
1414
logs.push(log.text());
1515
});
16-
return (...messages: string[]) =>
16+
return (...messages: (string | RegExp)[]) =>
1717
expect
1818
.poll(() => {
19-
if (messages.every((m) => logs.includes(m))) {
19+
if (
20+
messages.every((m) =>
21+
typeof m === "string"
22+
? logs.includes(m)
23+
: logs.some((l) => m.test(l)),
24+
)
25+
) {
2026
logs = [];
2127
return true;
2228
}

scripts/bundle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module.exports.default = react;`,
5757
copyFileSync("README.md", "dist/README.md");
5858

5959
execSync(
60-
"tsc src/index.ts --declaration --emitDeclarationOnly --outDir dist --module es2020 --moduleResolution bundler",
60+
"tsc src/index.ts --declaration --emitDeclarationOnly --outDir dist --target es2020 --module es2020 --moduleResolution bundler",
6161
{ stdio: "inherit" },
6262
);
6363

0 commit comments

Comments
 (0)