close
logo
Rstest
指南
配置
API
English
简体中文
指南
配置
API
English
简体中文
logo
Rstest
Overview

Test Configurations

root
name
include
exclude
setupFiles
projects
update
globals
passWithNoTests
includeSource
testNamePattern
env
bail
retry
testTimeout
hookTimeout
maxConcurrency
pool
isolate
testEnvironment
clearMocks
resetMocks
restoreMocks
unstubEnvs
unstubGlobals
coverage
reporters
logHeapUsage
hideSkippedTests
slowTestThreshold
snapshotFormat
chaiConfig
resolveSnapshotPath
printConsoleTrace
onConsoleLog
disableConsoleIntercept

Build Configurations

plugins
source
output
resolve
tools
dev
performance
📝 在 GitHub 上编辑此页
上一页env
下一页retry

#bail

  • 类型: number
  • 默认值: 0
  • CLI: --bail <number>

在指定个数的测试失败后中止测试运行。这对于在发生失败时提前停止测试运行非常有用。

将其设置为 0(默认值)表示将运行所有测试。将其设置为 1 将在第一个测试失败后停止测试运行。

CLI
rstest.config.ts
import { defineConfig } from '@rstest/core';

export default defineConfig({
  bail: 1,
});