Skip to content

Commit c44ccc4

Browse files
committed
Fix path matching in e2e test
1 parent f560a19 commit c44ccc4

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { dedent } from "ts-dedent";
21
import { describe, test } from "vitest";
32
import { runLongLived, seed } from "./helpers";
43

@@ -12,12 +11,11 @@ describe("nodejs_compat warnings", () => {
1211
}) => {
1312
const proc = await runLongLived("pnpm", "dev", projectPath);
1413
expect(await proc.exitCode).not.toBe(0);
15-
expect(proc.stderr.replaceAll("\\", "/")).toContain(
16-
dedent`
17-
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.
18-
- "node:assert/strict" imported from "src/index.ts"
19-
- "perf_hooks" imported from "src/index.ts"
20-
`
14+
const errorLogs = proc.stderr.replaceAll("\\", "/");
15+
expect(errorLogs).toContain(
16+
'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.'
2117
);
18+
expect(errorLogs).toContain('- "node:assert/strict" imported from');
19+
expect(errorLogs).toContain('- "perf_hooks" imported from');
2220
});
2321
});

packages/vite-plugin-cloudflare/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"magic-string": "^0.30.12",
6464
"mlly": "^1.7.4",
6565
"tree-kill": "^1.2.2",
66-
"ts-dedent": "^2.2.0",
6766
"tsdown": "0.16.3",
6867
"typescript": "catalog:default",
6968
"vite": "catalog:vite-plugin",

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)