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

# no-jasmine-globals

[Added in v0.6.0](https://github.com/web-infra-dev/rslint/releases/tag/v0.6.0)
## Configuration

| Preset                           | Configured Value |
| -------------------------------- | ---------------- |
| ✅ jestPlugin.configs.all         | `"error"`        |
| ✅ jestPlugin.configs.recommended | `"error"`        |


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

export default defineConfig([
  jestPlugin.configs.recommended,
  {
    rules: {
      'jest/no-jasmine-globals': 'error',
    },
  },
]);
```

## Rule Details

Jest supports running without Jasmine globals. This rule disallows using Jasmine-specific globals and APIs in tests, and requires the Jest equivalents instead.

Examples of **incorrect** code for this rule:

```typescript
spyOn(obj, 'method');
fail();
pending();
jasmine.addMatchers(matchers);
jasmine.createSpy();
jasmine.any(Number);
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
```

Examples of **correct** code for this rule:

```typescript
jest.spyOn(obj, 'method');
throw new Error('failed');
test.skip('skipped for now', () => {});
expect.extend(matchers);
jest.fn();
expect.any(Number);
jest.setTimeout(5000);
```

## Original Documentation

- [eslint-plugin-jest: no-jasmine-globals](https://github.com/jest-community/eslint-plugin-jest/blob/v29.16.0/docs/rules/no-jasmine-globals.md)
- [Source code](https://github.com/jest-community/eslint-plugin-jest/blob/v29.16.0/src/rules/no-jasmine-globals.ts)
