Skip to content

Commit 654e1b9

Browse files
authored
Update node compat warnings test (#8748)
1 parent 3993374 commit 654e1b9

File tree

1 file changed

+1
-3
lines changed
  • packages/vite-plugin-cloudflare/playground/node-compat/__tests__/worker-warnings

1 file changed

+1
-3
lines changed

packages/vite-plugin-cloudflare/playground/node-compat/__tests__/worker-warnings/warnings.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import { readFileSync, writeFileSync } from "node:fs";
2-
import { join } from "node:path";
31
import dedent from "ts-dedent";
42
import { expect, test, vi } from "vitest";
53
import { serverLogs } from "../../../__test-utils__";
64

75
test("should display warnings if nodejs_compat is missing", async () => {
86
await vi.waitFor(async () => {
9-
expect(serverLogs.warns[0]?.replaceAll("\\", "/")).toContain(
7+
expect(serverLogs.warns.join("").replaceAll("\\", "/")).toContain(
108
dedent`
119
Unexpected Node.js imports for environment "worker". Do you need to enable the "nodejs_compat" compatibility flag? Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details.
1210
- "node:assert/strict" imported from "worker-warnings/index.ts"

0 commit comments

Comments
 (0)