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

# exclude

- **Type:** `string[] | { patterns: string[]; override?: boolean }`
- **Default:** `['**/node_modules/**', '**/dist/**', '**/.{idea,git,cache,output,temp}/**']`
- **CLI:** `--exclude "**/node_modules/**"`

A list of glob patterns that should be excluded from your test files.

## Example

Exclude the test files under `node_modules`:


**CLI**

```bash
npx rstest --exclude "**/node_modules/**"
```


**rstest.config.ts**

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

export default defineConfig({
  include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)'],
  exclude: ['**/node_modules/**'],
});
```


## Override default value

By default, Rstest will merge your custom config with the default config. If you want to override the default `exclude` configuration, you can set `override` to `true`.

```ts title='rstest.config.ts'
import { defineConfig } from '@rstest/core';

export default defineConfig({
  include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)'],
  exclude: {
    patterns: ['**/node_modules/**'],
    override: true,
  },
});
```
