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

Test Configurations

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

Build Configurations

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

#hideSkippedTests

  • 类型: boolean
  • 默认值: false
  • CLI: --hideSkippedTests

不展示跳过测试的日志。

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

export default defineConfig({
  hideSkippedTests: true,
});

#示例

默认情况下,在你使用 verbose 报告器时,Rstest 会显示所有测试用例的日志。

 ✓ test/index.test.ts (2) 1ms
  ✓ Index > should add two numbers correctly (0ms)
  - Index > should test source code correctly (1ms)

 Test Files 1 passed
      Tests 1 passed | 1 skipped (2)
   Duration 93ms (build 50ms, tests 43ms)

当你设置 hideSkippedTests 为 true 时,Rstest 会在测试完成后隐藏所有跳过的测试用例的日志。

此时输出如下:

 ✓ test/index.test.ts (2) 1ms
  ✓ Index > should add two numbers correctly (0ms)

 Test Files 1 passed
      Tests 1 passed | 1 skipped (2)
   Duration 93ms (build 50ms, tests 43ms)