Skip to content

Commit

Permalink
fix(vitest): loosen onConsoleLog return type (#5337)
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Mar 5, 2024
1 parent c3eb8de commit 6d1b145
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/vitest/src/types/config.ts
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions test/web-worker/vitest.config.ts
Expand Up @@ -13,8 +13,7 @@ export default defineConfig({
},
},
onConsoleLog(log) {
if (log.includes('Failed to load'))
return false
return !log.includes('Failed to load')
},
},
})

0 comments on commit 6d1b145

Please sign in to comment.