> For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt.

# unstubGlobals

- **类型：** `boolean`
- **默认值：** `false`
- **CLI：** `--unstubGlobals`

每次测试时恢复之前使用 [rs.stubGlobal](/zh/api/runtime-api/rstest/utilities.md#rsstubglobal) 更改的所有全局变量。


**CLI**

```bash
npx rstest --unstubGlobals
```


**rstest.config.ts**

```ts
import { defineConfig } from '@rstest/core';

export default defineConfig({
  unstubGlobals: true,
});
```

