From 94c442dd19987817692a3c605e5422dee8dda66a Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa <4232207+hi-ogawa@users.noreply.github.com> Date: Thu, 22 Oct 2026 12:40:50 +0900 Subject: [PATCH] test: combine soft header tests Co-Authored-By: Claude Opus 5.5 --- test/e2e/test/retry.test.ts | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/test/e2e/test/retry.test.ts b/test/e2e/test/retry.test.ts index 0a829f635..1c0843e01 100644 --- a/test/e2e/test/retry.test.ts +++ b/test/e2e/test/retry.test.ts @@ -399,12 +399,15 @@ describe('failure summary header', () => { import { expect, test } from 'vitest' test('soft', { retry: 1 }, () => { - expect.soft(1).toBe(2) + for (let i = 0; i < 2; i++) { + expect.soft(1).toBe(2) + } expect.soft(2).toBe(3) }) `, }) + // the loop repeats the first error within each attempt; it still gets one header expect(extractFailureHeaders(stderr)).toMatchInlineSnapshot(` " FAIL basic.test.js > soft (retry 0, 1) AssertionError: expected 1 to be 2 // Object.is equality @@ -412,23 +415,4 @@ describe('failure summary header', () => { AssertionError: expected 2 to be 3 // Object.is equality" `) }) - - test('prints one unlabelled header for a test that runs once', async () => { - const { stderr } = await runInlineTests({ - 'basic.test.js': ` - import { expect, test } from 'vitest' - - test('soft in a loop', () => { - for (let i = 0; i < 2; i++) { - expect.soft(1).toBe(2) - } - }) - `, - }) - - expect(extractFailureHeaders(stderr)).toMatchInlineSnapshot(` - " FAIL basic.test.js > soft in a loop - AssertionError: expected 1 to be 2 // Object.is equality" - `) - }) }) -- 2.54.0