diff --git a/packages/wrangler/src/__tests__/d1/execute.test.ts b/packages/wrangler/src/__tests__/d1/execute.test.ts index 257375d9cc44..b52e09b78d99 100644 --- a/packages/wrangler/src/__tests__/d1/execute.test.ts +++ b/packages/wrangler/src/__tests__/d1/execute.test.ts @@ -50,6 +50,19 @@ describe("execute", () => { ).rejects.toThrowError(`Error: can't use --preview with --local`); }); + it("should reject the use of --preview with --local with --json", async () => { + setIsTTY(false); + writeWranglerToml({ + d1_databases: [ + { binding: "DATABASE", database_name: "db", database_id: "xxxx" }, + ], + }); + + await expect( + runWrangler(`d1 execute db --command "select;" --local --preview --json`) + ).rejects.toThrowError(`Error: can't use --preview with --local`); + }); + it("should expect --local when using --persist-to", async () => { setIsTTY(false); writeWranglerToml({