Skip to content

Commit 6d1b145

Browse files
authoredMar 5, 2024··
fix(vitest): loosen onConsoleLog return type (#5337)
1 parent c3eb8de commit 6d1b145

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed
 

‎packages/vitest/src/types/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ export interface InlineConfig {
580580
*
581581
* Return `false` to ignore the log.
582582
*/
583-
onConsoleLog?: (log: string, type: 'stdout' | 'stderr') => false | void
583+
onConsoleLog?: (log: string, type: 'stdout' | 'stderr') => boolean | void
584584

585585
/**
586586
* Enable stack trace filtering. If absent, all stack trace frames

‎test/web-worker/vitest.config.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ export default defineConfig({
1313
},
1414
},
1515
onConsoleLog(log) {
16-
if (log.includes('Failed to load'))
17-
return false
16+
return !log.includes('Failed to load')
1817
},
1918
},
2019
})

0 commit comments

Comments
 (0)
Please sign in to comment.