From a78e6bd0e0d8d3a1a8c632189121b4122438579e Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Mon, 10 Jul 2023 06:56:52 +0800 Subject: [PATCH] fix: modify condition --- packages/vitest/src/node/error.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vitest/src/node/error.ts b/packages/vitest/src/node/error.ts index 98d097d3b79f..fd4c5494986c 100644 --- a/packages/vitest/src/node/error.ts +++ b/packages/vitest/src/node/error.ts @@ -191,7 +191,7 @@ export function displayDiff(diff: string | null, console: Console) { function printErrorMessage(error: ErrorWithDiff, logger: Logger) { const errorName = error.name || error.nameStr || 'Unknown Error' - if (!(error instanceof Error)) { + if (!error.message) { logger.error(error) return }