Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
rozenmd committed Jan 31, 2024
1 parent ee9b161 commit d5b4948
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/wrangler/src/__tests__/d1/execute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit d5b4948

Please sign in to comment.