Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 738 Bytes

File metadata and controls

28 lines (21 loc) · 738 Bytes
title dangerouslyIgnoreUnhandledErrors | 配置
outline deep

dangerouslyIgnoreUnhandledErrors

  • 类型: boolean
  • 默认值: false
  • 命令行终端:
    • --dangerouslyIgnoreUnhandledErrors
    • --dangerouslyIgnoreUnhandledErrors=false

如果将此选项设为 true,即使存在未处理错误,Vitest 也不会导致测试运行失败。注意:内置报告器仍会显示这些错误。

如需按条件过滤特定错误,请改用 onUnhandledError 回调函数。

示例 {#example}

import { defineConfig } from 'vitest/config'

export default defineConfig({
  test: {
    dangerouslyIgnoreUnhandledErrors: true,
  },
})