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/unstub-globals.md.
close
  • 简体中文
  • unstubGlobals

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

    在每次测试执行前自动调用 rs.unstubAllGlobals(),将通过 rs.stubGlobal() 修改的所有 globalThis 属性恢复为原始描述符(或删除原本不存在的属性)。

    CLI
    rstest.config.ts
    npx rstest --unstubGlobals