From 56b09dc0c441d8bc140a76bd721b8acd99f64608 Mon Sep 17 00:00:00 2001 From: emily-shen <69125074+emily-shen@users.noreply.github.com> Date: Mon, 17 Feb 2025 18:05:09 +0000 Subject: [PATCH] fix fixture --- .../type-generation.file-comment.test.ts | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/fixtures/type-generation/tests/type-generation.file-comment.test.ts b/fixtures/type-generation/tests/type-generation.file-comment.test.ts index 841feec8491c..74801ea5b392 100644 --- a/fixtures/type-generation/tests/type-generation.file-comment.test.ts +++ b/fixtures/type-generation/tests/type-generation.file-comment.test.ts @@ -28,7 +28,7 @@ describe("`wrangler types` - file comment", () => { "packages", "wrangler" ); - execSync(`npx ${wranglerPath} types ${args}`, { + execSync(`npx ${wranglerPath} types ${args} --include-runtime=false`, { cwd: tempDir, }); const typesFile = join(tempDir, expectedOutputFile); @@ -38,7 +38,13 @@ describe("`wrangler types` - file comment", () => { describe("includes a comment specifying the command run", () => { it("(base command)", async ({ expect }) => { const typesCommandOutput = runWranglerTypesCommand(); - expect(typesCommandOutput).toContain("by running `wrangler types`"); + expect(typesCommandOutput).toMatchInlineSnapshot(` + "// Generated by Wrangler by running \`wrangler types --include-runtime=false\` + interface Env { + MY_VAR: "my-var-value"; + } + " + `); }); it("(with types customization)", async ({ expect }) => { @@ -46,16 +52,24 @@ describe("`wrangler types` - file comment", () => { "--env-interface MyCloudflareEnv ./cflare-env.d.ts", "./cflare-env.d.ts" ); - expect(typesCommandOutput).toContain( - "by running `wrangler types --env-interface MyCloudflareEnv ./cflare-env.d.ts`" - ); + expect(typesCommandOutput).toMatchInlineSnapshot(` + "// Generated by Wrangler by running \`wrangler types --env-interface MyCloudflareEnv ./cflare-env.d.ts --include-runtime=false\` + interface MyCloudflareEnv { + MY_VAR: "my-var-value"; + } + " + `); }); it("(with wrangler top level options)", async ({ expect }) => { const typesCommandOutput = runWranglerTypesCommand("-c wranglerA.toml"); - expect(typesCommandOutput).toContain( - "by running `wrangler types -c wranglerA.toml`" - ); + expect(typesCommandOutput).toMatchInlineSnapshot(` + "// Generated by Wrangler by running \`wrangler types -c wranglerA.toml --include-runtime=false\` + interface Env { + MY_VAR: "my-var-value"; + } + " + `); }); }); });