Skip to content

Commit 88c583b

Browse files
committed
address feedback
1 parent bedb0c5 commit 88c583b

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

fixtures/dev-registry/tests/dev-registry.test.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,19 @@ async function runWranglerDev(
5151

5252
async function setupPlatformProxy(config: string, devRegistryPath?: string) {
5353
vi.stubEnv("WRANGLER_REGISTRY_PATH", devRegistryPath);
54-
try {
55-
// @ts-expect-error It works
56-
const wrangler = await import("wrangler");
57-
const proxy = await wrangler.getPlatformProxy<Record<string, any>>({
58-
configPath: config,
59-
});
6054

61-
onTestFinished(() => proxy.dispose());
55+
onTestFinished(() => {
56+
vi.unstubAllEnvs();
57+
});
58+
59+
const wrangler = await import("wrangler");
60+
const proxy = await wrangler.getPlatformProxy<Record<string, any>>({
61+
configPath: config,
62+
});
63+
64+
onTestFinished(() => proxy.dispose());
6265

63-
return proxy;
64-
} finally {
65-
// Unset the environment variable to avoid affecting other tests
66-
vi.stubEnv("WRANGLER_REGISTRY_PATH", undefined);
67-
}
66+
return proxy;
6867
}
6968

7069
describe("Dev Registry: vite dev <-> vite dev", () => {

fixtures/dev-registry/tests/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "@cloudflare/workers-tsconfig/tsconfig.json",
33
"compilerOptions": {
4+
"module": "esnext",
45
"types": ["node"]
56
},
67
"include": ["**/*.ts", "../../../node-types.d.ts"]

0 commit comments

Comments
 (0)