From 6d1b145118d42b14bc0739820c4ce9e17fbd45dd Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Tue, 5 Mar 2024 19:06:16 +0900 Subject: [PATCH] fix(vitest): loosen `onConsoleLog` return type (#5337) --- packages/vitest/src/types/config.ts | 2 +- test/web-worker/vitest.config.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/vitest/src/types/config.ts b/packages/vitest/src/types/config.ts index b8db4b5e5d49..2c1e5951d3c5 100644 --- a/packages/vitest/src/types/config.ts +++ b/packages/vitest/src/types/config.ts @@ -580,7 +580,7 @@ export interface InlineConfig { * * Return `false` to ignore the log. */ - onConsoleLog?: (log: string, type: 'stdout' | 'stderr') => false | void + onConsoleLog?: (log: string, type: 'stdout' | 'stderr') => boolean | void /** * Enable stack trace filtering. If absent, all stack trace frames diff --git a/test/web-worker/vitest.config.ts b/test/web-worker/vitest.config.ts index c6de0b5c72d0..e2505eb392e5 100644 --- a/test/web-worker/vitest.config.ts +++ b/test/web-worker/vitest.config.ts @@ -13,8 +13,7 @@ export default defineConfig({ }, }, onConsoleLog(log) { - if (log.includes('Failed to load')) - return false + return !log.includes('Failed to load') }, }, })