Skip to content

Commit

Permalink
fix: snapshots overlap when using the same name in different describes (
Browse files Browse the repository at this point in the history
#10)

Signed-off-by: Chapman Pendery <[email protected]>
  • Loading branch information
cpendery authored Mar 1, 2024
1 parent ae8d00c commit 5fdfc3a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/__snapshots__/screenshot.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// TUI Test Snapshot v1

exports[`take a screenshot 1`] = String.raw`
exports[`take a screenshot | 1`] = String.raw`
╭────────────────────────────────────────╮
│> foo │
│ │
Expand Down
3 changes: 2 additions & 1 deletion src/runner/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ const runTest = async (
const signatureIdx = signatureIdenticalTests.findIndex(
(t) => t.id == test.id
);
const currentConcurrentTestName = () => `${test.title} ${signatureIdx + 1}`;
const currentConcurrentTestName = () =>
`${test.titlePath().slice(1).join(" › ")} | ${signatureIdx + 1}`;

expect.setState({
...expect.getState(),
Expand Down
8 changes: 4 additions & 4 deletions test/__snapshots__/e2e.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// TUI Test Snapshot v1

exports[`ctrl+c 1`] = String.raw`
exports[`key controls › ctrl+c | 1`] = String.raw`
╭────────────────────────────────────────────────────────────────────────────────╮
│> │
│ │
Expand All @@ -20,7 +20,7 @@ exports[`ctrl+c 1`] = String.raw`
╰────────────────────────────────────────────────────────────────────────────────╯
`;

exports[`ctrl+c 1 1`] = String.raw`
exports[`key controls › ctrl+c | 1 1`] = String.raw`
╭────────────────────────────────────────────────────────────────────────────────╮
│> ^C │
│> │
Expand All @@ -40,7 +40,7 @@ exports[`ctrl+c 1 1`] = String.raw`
╰────────────────────────────────────────────────────────────────────────────────╯
`;

exports[`resize 1`] = String.raw`
exports[`terminal functions › resize | 1`] = String.raw`
╭────────────────────────────────────────────────────────────────────────────────╮
│> foo │
│ │
Expand All @@ -60,7 +60,7 @@ exports[`resize 1`] = String.raw`
╰────────────────────────────────────────────────────────────────────────────────╯
`;

exports[`resize 1 1`] = String.raw`
exports[`terminal functions › resize | 1 1`] = String.raw`
╭────────────────────────────────────────╮
│> foobar │
│ │
Expand Down

0 comments on commit 5fdfc3a

Please sign in to comment.