---
source: crates/oxc_linter/src/tester.rs
---
  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:15]
 1 │ expect(value).toEqual("my string");
   ·               ───────
   ╰────
  help: Replace `toEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:15]
 1 │ expect(value).toStrictEqual("my string");
   ·               ─────────────
   ╰────
  help: Replace `toStrictEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:15]
 1 │ expect(value).toStrictEqual(1);
   ·               ─────────────
   ╰────
  help: Replace `toStrictEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:15]
 1 │ expect(value).toStrictEqual(1,);
   ·               ─────────────
   ╰────
  help: Replace `toStrictEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:15]
 1 │ expect(value).toStrictEqual(-1);
   ·               ─────────────
   ╰────
  help: Replace `toStrictEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:15]
 1 │ expect(value).toEqual(`my string`);
   ·               ───────
   ╰────
  help: Replace `toEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:15]
 1 │ expect(value)["toEqual"](`my string`);
   ·               ─────────
   ╰────
  help: Replace `"toEqual"` with `"toBe"`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:15]
 1 │ expect(value).toStrictEqual(`my ${string}`);
   ·               ─────────────
   ╰────
  help: Replace `toStrictEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:32]
 1 │ expect(loadMessage()).resolves.toStrictEqual("hello world");
   ·                                ─────────────
   ╰────
  help: Replace `toStrictEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:32]
 1 │ expect(loadMessage()).resolves["toStrictEqual"]("hello world");
   ·                                ───────────────
   ╰────
  help: Replace `"toStrictEqual"` with `"toBe"`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:35]
 1 │ expect(loadMessage())["resolves"].toStrictEqual("hello world");
   ·                                   ─────────────
   ╰────
  help: Replace `toStrictEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:32]
 1 │ expect(loadMessage()).resolves.toStrictEqual(false);
   ·                                ─────────────
   ╰────
  help: Replace `toStrictEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.
   ╭─[prefer_to_be.tsx:1:14]
 1 │ expect(null).toBe(null);
   ·              ────
   ╰────
  help: Replace `toBe(null)` with `toBeNull()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.
   ╭─[prefer_to_be.tsx:1:14]
 1 │ expect(null).toEqual(null);
   ·              ───────
   ╰────
  help: Replace `toEqual(null)` with `toBeNull()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.
   ╭─[prefer_to_be.tsx:1:14]
 1 │ expect(null).toEqual(null,);
   ·              ───────
   ╰────
  help: Replace `toEqual(null,)` with `toBeNull()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.
   ╭─[prefer_to_be.tsx:1:14]
 1 │ expect(null).toStrictEqual(null);
   ·              ─────────────
   ╰────
  help: Replace `toStrictEqual(null)` with `toBeNull()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toBe(null);
   ·                        ────
   ╰────
  help: Replace `toBe(null)` with `toBeNull()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not["toBe"](null);
   ·                        ──────
   ╰────
  help: Replace `"toBe"](null)` with `"toBeNull"]()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.
   ╭─[prefer_to_be.tsx:1:27]
 1 │ expect("a string")["not"]["toBe"](null);
   ·                           ──────
   ╰────
  help: Replace `"toBe"](null)` with `"toBeNull"]()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toEqual(null);
   ·                        ───────
   ╰────
  help: Replace `toEqual(null)` with `toBeNull()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toStrictEqual(null);
   ·                        ─────────────
   ╰────
  help: Replace `toStrictEqual(null)` with `toBeNull()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeUndefined` instead.
   ╭─[prefer_to_be.tsx:1:19]
 1 │ expect(undefined).toBe(undefined);
   ·                   ────
   ╰────
  help: Replace `toBe(undefined)` with `toBeUndefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeUndefined` instead.
   ╭─[prefer_to_be.tsx:1:19]
 1 │ expect(undefined).toEqual(undefined);
   ·                   ───────
   ╰────
  help: Replace `toEqual(undefined)` with `toBeUndefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeUndefined` instead.
   ╭─[prefer_to_be.tsx:1:19]
 1 │ expect(undefined).toStrictEqual(undefined);
   ·                   ─────────────
   ╰────
  help: Replace `toStrictEqual(undefined)` with `toBeUndefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeDefined` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toBe(undefined);
   ·                        ────
   ╰────
  help: Replace `not.toBe(undefined)` with `toBeDefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeDefined` instead.
   ╭─[prefer_to_be.tsx:1:32]
 1 │ expect("a string").rejects.not.toBe(undefined);
   ·                                ────
   ╰────
  help: Replace `not.toBe(undefined)` with `toBeDefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeDefined` instead.
   ╭─[prefer_to_be.tsx:1:32]
 1 │ expect("a string").rejects.not["toBe"](undefined);
   ·                                ──────
   ╰────
  help: Replace `.not["toBe"](undefined)` with `["toBeDefined"]()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeDefined` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toEqual(undefined);
   ·                        ───────
   ╰────
  help: Replace `not.toEqual(undefined)` with `toBeDefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeDefined` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toStrictEqual(undefined);
   ·                        ─────────────
   ╰────
  help: Replace `not.toStrictEqual(undefined)` with `toBeDefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNaN` instead.
   ╭─[prefer_to_be.tsx:1:13]
 1 │ expect(NaN).toBe(NaN);
   ·             ────
   ╰────
  help: Replace `toBe(NaN)` with `toBeNaN()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNaN` instead.
   ╭─[prefer_to_be.tsx:1:13]
 1 │ expect(NaN).toEqual(NaN);
   ·             ───────
   ╰────
  help: Replace `toEqual(NaN)` with `toBeNaN()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNaN` instead.
   ╭─[prefer_to_be.tsx:1:13]
 1 │ expect(NaN).toStrictEqual(NaN);
   ·             ─────────────
   ╰────
  help: Replace `toStrictEqual(NaN)` with `toBeNaN()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNaN` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toBe(NaN);
   ·                        ────
   ╰────
  help: Replace `toBe(NaN)` with `toBeNaN()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNaN` instead.
   ╭─[prefer_to_be.tsx:1:32]
 1 │ expect("a string").rejects.not.toBe(NaN);
   ·                                ────
   ╰────
  help: Replace `toBe(NaN)` with `toBeNaN()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNaN` instead.
   ╭─[prefer_to_be.tsx:1:35]
 1 │ expect("a string")["rejects"].not.toBe(NaN);
   ·                                   ────
   ╰────
  help: Replace `toBe(NaN)` with `toBeNaN()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNaN` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toEqual(NaN);
   ·                        ───────
   ╰────
  help: Replace `toEqual(NaN)` with `toBeNaN()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNaN` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toStrictEqual(NaN);
   ·                        ─────────────
   ╰────
  help: Replace `toStrictEqual(NaN)` with `toBeNaN()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeUndefined` instead.
   ╭─[prefer_to_be.tsx:1:23]
 1 │ expect(undefined).not.toBeDefined();
   ·                       ───────────
   ╰────
  help: Replace `not.toBeDefined()` with `toBeUndefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeUndefined` instead.
   ╭─[prefer_to_be.tsx:1:32]
 1 │ expect(undefined).resolves.not.toBeDefined();
   ·                                ───────────
   ╰────
  help: Replace `not.toBeDefined()` with `toBeUndefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeUndefined` instead.
   ╭─[prefer_to_be.tsx:1:28]
 1 │ expect(undefined).resolves.toBe(undefined);
   ·                            ────
   ╰────
  help: Replace `toBe(undefined)` with `toBeUndefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeDefined` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toBeUndefined();
   ·                        ─────────────
   ╰────
  help: Replace `not.toBeUndefined()` with `toBeDefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeDefined` instead.
   ╭─[prefer_to_be.tsx:1:32]
 1 │ expect("a string").rejects.not.toBeUndefined();
   ·                                ─────────────
   ╰────
  help: Replace `not.toBeUndefined()` with `toBeDefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:14]
 1 │ expect(null).toEqual(1 as unknown as string as unknown as any);
   ·              ───────
   ╰────
  help: Replace `toEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:14]
 1 │ expect(null).toEqual(-1 as unknown as string as unknown as any);
   ·              ───────
   ╰────
  help: Replace `toEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toStrictEqual("string" as number);
   ·                        ─────────────
   ╰────
  help: Replace `toStrictEqual` with `toBe`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.
   ╭─[prefer_to_be.tsx:1:14]
 1 │ expect(null).toBe(null as unknown as string as unknown as any);
   ·              ────
   ╰────
  help: Replace `toBe(null as unknown as string as unknown as any)` with `toBeNull()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.
   ╭─[prefer_to_be.tsx:1:24]
 1 │ expect("a string").not.toEqual(null as number);
   ·                        ───────
   ╰────
  help: Replace `toEqual(null as number)` with `toBeNull()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeUndefined` instead.
   ╭─[prefer_to_be.tsx:1:19]
 1 │ expect(undefined).toBe(undefined as unknown as string as any);
   ·                   ────
   ╰────
  help: Replace `toBe(undefined as unknown as string as any)` with `toBeUndefined()`.

  ⚠ eslint-plugin-jest(prefer-to-be): Use `toBeUndefined` instead.
   ╭─[prefer_to_be.tsx:1:20]
 1 │ expect("a string").toEqual(undefined as number);
   ·                    ───────
   ╰────
  help: Replace `toEqual(undefined as number)` with `toBeUndefined()`.
