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/disable-console-intercept.md.
close
  • 简体中文
  • disableConsoleIntercept

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

    禁用 Rstest 对 console 日志的拦截。默认情况下,Rstest 会拦截 console 调用以追踪日志所在的测试来源。

    CLI
    rstest.config.ts
    npx rstest --disableConsoleIntercept

    设为 true 后,onConsoleLog 和 printConsoleTrace 配置不会生效。如果同时启用了 silent,Rstest 仍会保留一条内部拦截通道,以便 silent 继续控制测试日志输出;在 Browser Mode 下,该通道仍会调用原始 console.* 供 DevTools 使用。