Skip to content

Commit 3d88fea

Browse files
committed
fix fixture
1 parent 77ecdf4 commit 3d88fea

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

fixtures/type-generation/tests/type-generation.file-comment.test.ts

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe("`wrangler types` - file comment", () => {
2828
"packages",
2929
"wrangler"
3030
);
31-
execSync(`npx ${wranglerPath} types ${args}`, {
31+
execSync(`npx ${wranglerPath} types ${args} --include-runtime=false`, {
3232
cwd: tempDir,
3333
});
3434
const typesFile = join(tempDir, expectedOutputFile);
@@ -38,24 +38,38 @@ describe("`wrangler types` - file comment", () => {
3838
describe("includes a comment specifying the command run", () => {
3939
it("(base command)", async ({ expect }) => {
4040
const typesCommandOutput = runWranglerTypesCommand();
41-
expect(typesCommandOutput).toContain("by running `wrangler types`");
41+
expect(typesCommandOutput).toMatchInlineSnapshot(`
42+
"// Generated by Wrangler by running \`wrangler types --include-runtime=false\`
43+
interface Env {
44+
MY_VAR: "my-var-value";
45+
}
46+
"
47+
`);
4248
});
4349

4450
it("(with types customization)", async ({ expect }) => {
4551
const typesCommandOutput = runWranglerTypesCommand(
4652
"--env-interface MyCloudflareEnv ./cflare-env.d.ts",
4753
"./cflare-env.d.ts"
4854
);
49-
expect(typesCommandOutput).toContain(
50-
"by running `wrangler types --env-interface MyCloudflareEnv ./cflare-env.d.ts`"
51-
);
55+
expect(typesCommandOutput).toMatchInlineSnapshot(`
56+
"// Generated by Wrangler by running \`wrangler types --env-interface MyCloudflareEnv ./cflare-env.d.ts --include-runtime=false\`
57+
interface MyCloudflareEnv {
58+
MY_VAR: "my-var-value";
59+
}
60+
"
61+
`);
5262
});
5363

5464
it("(with wrangler top level options)", async ({ expect }) => {
5565
const typesCommandOutput = runWranglerTypesCommand("-c wranglerA.toml");
56-
expect(typesCommandOutput).toContain(
57-
"by running `wrangler types -c wranglerA.toml`"
58-
);
66+
expect(typesCommandOutput).toMatchInlineSnapshot(`
67+
"// Generated by Wrangler by running \`wrangler types -c wranglerA.toml --include-runtime=false\`
68+
interface Env {
69+
MY_VAR: "my-var-value";
70+
}
71+
"
72+
`);
5973
});
6074
});
6175
});

0 commit comments

Comments
 (0)