diff --git a/packages/ui/client/components/dashboard/ErrorEntry.vue b/packages/ui/client/components/dashboard/ErrorEntry.vue index a593e55ca..c6151b80d 100644 --- a/packages/ui/client/components/dashboard/ErrorEntry.vue +++ b/packages/ui/client/components/dashboard/ErrorEntry.vue @@ -20,13 +20,13 @@ defineProps<{ This error originated in {{ error.VITEST_TEST_PATH }} test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

- The latest test that might've caused the error is {{ error.VITEST_TEST_NAME }}. It might mean one of the following:
+ The last test to run before this error was "{{ error.VITEST_TEST_NAME }}. This means either:
diff --git a/packages/vitest/src/node/printError.ts b/packages/vitest/src/node/printError.ts index 3fc6f50ae..53135a0ea 100644 --- a/packages/vitest/src/node/printError.ts +++ b/packages/vitest/src/node/printError.ts @@ -237,11 +237,11 @@ function printErrorInner( if (testName) { logger.error( c.red( - `The latest test that might've caused the error is "${c.bold( + `The last test to run before this error was "${c.bold( testName, - )}". It might mean one of the following:` - + '\n- The error was thrown, while Vitest was running this test.' - + '\n- If the error occurred after the test had been completed, this was the last documented test before it was thrown.', + )}". This means either:` + + '\n- the error was thrown while Vitest was running this test, or' + + '\n- the error was thrown after the test completed, and this was the most recent test at that point.', ), ) } diff --git a/test/browser/specs/errors.test.ts b/test/browser/specs/errors.test.ts index 22851a1ab..f0c40b6f8 100644 --- a/test/browser/specs/errors.test.ts +++ b/test/browser/specs/errors.test.ts @@ -11,7 +11,7 @@ test('prints correct unhandled error stack', async () => { expect(stderr).toContain('throw-unhandled-error.test.ts:9:10') expect(stderr).toContain('This error originated in "throw-unhandled-error.test.ts" test file.') - expect(stderr).toContain('The latest test that might\'ve caused the error is "unhandled exception".') + expect(stderr).toContain('The last test to run before this error was "unhandled exception".') if (instances.some(({ browser }) => browser === 'webkit')) { expect(stderr).toContain('throw-unhandled-error.test.ts:9:20') diff --git a/test/e2e/test/reporters/__snapshots__/junit.test.ts.snap b/test/e2e/test/reporters/__snapshots__/junit.test.ts.snap index b8e60be0c..1271a53c0 100644 --- a/test/e2e/test/reporters/__snapshots__/junit.test.ts.snap +++ b/test/e2e/test/reporters/__snapshots__/junit.test.ts.snap @@ -73,9 +73,9 @@ Error: uncaught timer ❯ Timeout._onTimeout multi.test.ts:7:11 This error originated in "multi.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. -The latest test that might've caused the error is "triggers two rejections and one uncaught exception". It might mean one of the following: -- The error was thrown, while Vitest was running this test. -- If the error occurred after the test had been completed, this was the last documented test before it was thrown. +The last test to run before this error was "triggers two rejections and one uncaught exception". This means either: +- the error was thrown while Vitest was running this test, or +- the error was thrown after the test completed, and this was the most recent test at that point. @@ -84,9 +84,9 @@ Error: first rejection ❯ multi.test.ts:4:23 This error originated in "multi.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. -The latest test that might've caused the error is "triggers two rejections and one uncaught exception". It might mean one of the following: -- The error was thrown, while Vitest was running this test. -- If the error occurred after the test had been completed, this was the last documented test before it was thrown. +The last test to run before this error was "triggers two rejections and one uncaught exception". This means either: +- the error was thrown while Vitest was running this test, or +- the error was thrown after the test completed, and this was the most recent test at that point. @@ -95,9 +95,9 @@ Error: second rejection ❯ multi.test.ts:5:23 This error originated in "multi.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. -The latest test that might've caused the error is "triggers two rejections and one uncaught exception". It might mean one of the following: -- The error was thrown, while Vitest was running this test. -- If the error occurred after the test had been completed, this was the last documented test before it was thrown. +The last test to run before this error was "triggers two rejections and one uncaught exception". This means either: +- the error was thrown while Vitest was running this test, or +- the error was thrown after the test completed, and this was the most recent test at that point. @@ -234,9 +234,9 @@ Error: rejection from space-1 ❯ test/reject.test.ts:4:23 This error originated in "test/reject.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. -The latest test that might've caused the error is "triggers a rejection from project 1". It might mean one of the following: -- The error was thrown, while Vitest was running this test. -- If the error occurred after the test had been completed, this was the last documented test before it was thrown. +The last test to run before this error was "triggers a rejection from project 1". This means either: +- the error was thrown while Vitest was running this test, or +- the error was thrown after the test completed, and this was the most recent test at that point. @@ -245,9 +245,9 @@ Error: rejection from space-2 ❯ test/reject.test.ts:4:23 This error originated in "test/reject.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. -The latest test that might've caused the error is "triggers a rejection from project 2". It might mean one of the following: -- The error was thrown, while Vitest was running this test. -- If the error occurred after the test had been completed, this was the last documented test before it was thrown. +The last test to run before this error was "triggers a rejection from project 2". This means either: +- the error was thrown while Vitest was running this test, or +- the error was thrown after the test completed, and this was the most recent test at that point.