From 1f1152150dfb8be4a0648a7536a61bc43471e533 Mon Sep 17 00:00:00 2001 From: Chapman Pendery Date: Fri, 1 Mar 2024 12:49:29 -0800 Subject: [PATCH] fix: snapshots overlap when using the same name in different describes Signed-off-by: Chapman Pendery --- examples/__snapshots__/screenshot.test.ts.snap | 2 +- src/runner/worker.ts | 3 ++- test/__snapshots__/e2e.test.ts.snap | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/__snapshots__/screenshot.test.ts.snap b/examples/__snapshots__/screenshot.test.ts.snap index 3d9b0a7..5c0dbb8 100644 --- a/examples/__snapshots__/screenshot.test.ts.snap +++ b/examples/__snapshots__/screenshot.test.ts.snap @@ -1,6 +1,6 @@ // TUI Test Snapshot v1 -exports[`take a screenshot 1`] = String.raw` +exports[`take a screenshot | 1`] = String.raw` ╭────────────────────────────────────────╮ │> foo │ │ │ diff --git a/src/runner/worker.ts b/src/runner/worker.ts index a60f6ec..f4cea77 100644 --- a/src/runner/worker.ts +++ b/src/runner/worker.ts @@ -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(), diff --git a/test/__snapshots__/e2e.test.ts.snap b/test/__snapshots__/e2e.test.ts.snap index 4c955c0..57da140 100644 --- a/test/__snapshots__/e2e.test.ts.snap +++ b/test/__snapshots__/e2e.test.ts.snap @@ -1,6 +1,6 @@ // TUI Test Snapshot v1 -exports[`ctrl+c 1`] = String.raw` +exports[`key controls › ctrl+c | 1`] = String.raw` ╭────────────────────────────────────────────────────────────────────────────────╮ │> │ │ │ @@ -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 │ │> │ @@ -40,7 +40,7 @@ exports[`ctrl+c 1 1`] = String.raw` ╰────────────────────────────────────────────────────────────────────────────────╯ `; -exports[`resize 1`] = String.raw` +exports[`terminal functions › resize | 1`] = String.raw` ╭────────────────────────────────────────────────────────────────────────────────╮ │> foo │ │ │ @@ -60,7 +60,7 @@ exports[`resize 1`] = String.raw` ╰────────────────────────────────────────────────────────────────────────────────╯ `; -exports[`resize 1 1`] = String.raw` +exports[`terminal functions › resize | 1 1`] = String.raw` ╭────────────────────────────────────────╮ │> foobar │ │ │