For AI agents: the complete documentation index is available at https://rstest.rs/zh/llms.txt, the full documentation bundle is available at https://rstest.rs/zh/llms-full.txt, and this page is available as Markdown at https://rstest.rs/zh/config/test/test-name-pattern.md.
close
  • 简体中文
  • testNamePattern

    • 类型: string | RegExp
    • 默认值: undefined
    • CLI: -t=<value>, --testNamePattern=<value>

    按 RegExp 或正则模式字符串(通过 new RegExp() 编译)过滤测试的完整名称。

    完整名称将外层 describe 套件名称与测试用例名称用空格拼接(当模式中包含 > 时改为用 ' > ' 拼接)。

    CLI
    rstest.config.ts
    npx rstest -t=bar

    匹配规则、完整名称示例以及排除测试的负向先行断言正则写法,请参考根据测试名称过滤。