# no-jasmine-globals

Rule `jest/no-jasmine-globals`. Disallow Jasmine globals

- Source: jest
- Technologies: Testing
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 16.7M weekly downloads of presets that enable it
- Trend: +10.1% last quarter
- Rank: #656 by reach, #1463 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `jest/no-jasmine-globals` | yes | safe | package `eslint-plugin-jest` | [docs](https://github.com/jest-community/eslint-plugin-jest/blob/v29.17.2/docs/rules/no-jasmine-globals.md) |
| Oxlint | `jest/no-jasmine-globals` | no | safe | plugin `jest`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/jest/no-jasmine-globals.html) |
| Biome | `nursery/noJasmineGlobals` | no | unsafe | group nursery, since 2.6.9 | [docs](https://biomejs.dev/linter/rules/no-jasmine-globals/) |

## Code examples

### Incorrect: the rule reports this

```js
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
test('my test', () => {
  pending();
});
test('my test', () => {
  jasmine.createSpy();
});
```

### Correct: the rule accepts this

```js
jest.setTimeout(5000);
test('my test', () => {
  // Use test.skip() instead of pending()
});
test.skip('my test', () => {
  // Skipped test
});
test('my test', () => {
  jest.fn(); // Use jest.fn() instead of jasmine.createSpy()
});
```

Examples from the Oxlint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import jest from "eslint-plugin-jest";

export default [
  {
    plugins: { jest },
    rules: {
      "jest/no-jasmine-globals": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "jest"
  ],
  "rules": {
    "jest/no-jasmine-globals": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noJasmineGlobals": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Jest recommended](https://lintradar.dev/presets/jest-recommended.md) | ESLint | `eslint-plugin-jest` | 19 | 16.7M | +10.1% |

## Related rules

- [jest/no-done-callback](https://lintradar.dev/rules/jest/no-done-callback.md): Disallow using a callback in asynchronous tests and hooks
- [jest/no-standalone-expect](https://lintradar.dev/rules/jest/no-standalone-expect.md): Disallow using `expect` outside of `it` or `test` blocks
- [jest/no-conditional-expect](https://lintradar.dev/rules/jest/no-conditional-expect.md): Disallow calling `expect` conditionally
- [jest/valid-title](https://lintradar.dev/rules/jest/valid-title.md): Enforce valid titles
- [jest/expect-expect](https://lintradar.dev/rules/jest/expect-expect.md): Enforce assertion to be made in a test body
- [jest/no-alias-methods](https://lintradar.dev/rules/jest/no-alias-methods.md): Disallow alias methods

---

Web page: https://lintradar.dev/rules/jest/no-jasmine-globals. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
