Skip to content

Commit 3b77458

Browse files
jsfezclaude
andcommitted
test: cover the capture index in the snapshot command
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent d7e8669 commit 3b77458

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎packages/vitest/src/snapshot-command.test.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ describe("createArgosSnapshotCommand", () => {
2929
"serialized",
3030
{ root: "/abs/screenshots" },
3131
undefined,
32+
undefined,
3233
);
3334
});
3435

@@ -44,6 +45,7 @@ describe("createArgosSnapshotCommand", () => {
4445
"serialized",
4546
{ root: "/other", extension: ".json", tag: "a" },
4647
undefined,
48+
undefined,
4749
);
4850
});
4951

@@ -61,6 +63,19 @@ describe("createArgosSnapshotCommand", () => {
6163
"serialized",
6264
{ root: "/abs/screenshots" },
6365
test,
66+
undefined,
67+
);
68+
});
69+
70+
it("forwards the capture index to the writer", async () => {
71+
const command = createArgosSnapshotCommand({ root: "/abs/screenshots" });
72+
await command(ctx, "user", "serialized", undefined, undefined, 2);
73+
expect(writeSnapshotFile).toHaveBeenCalledWith(
74+
"user",
75+
"serialized",
76+
{ root: "/abs/screenshots" },
77+
undefined,
78+
2,
6479
);
6580
});
6681
});

0 commit comments

Comments
 (0)