close
logo
Rstest
Guide
Config
API
English
简体中文
Guide
Config
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
📝 Edit this page on GitHub
Previous Pageenv
Next Pageretry

#bail

  • Type: number
  • Default: 0
  • CLI: --bail <number>

Abort the test run after the specified number of test failures. This is useful for stopping test runs early when failures occur.

Setting this to 0 (the default) means to run all tests regardless of failures. Setting this to 1 will stop the test run after the first test failure.

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

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