---
source: crates/oxc_linter/src/tester.rs
---
  ⚠ eslint-plugin-jest(require-to-throw-message): Require a message for "toThrow".
   ╭─[require_to_throw_message.tsx:1:41]
 1 │ expect(() => { throw new Error('a'); }).toThrow();
   ·                                         ───────
   ╰────
  help: Add an error message to "toThrow"

  ⚠ eslint-plugin-jest(require-to-throw-message): Require a message for "toThrowError".
   ╭─[require_to_throw_message.tsx:1:41]
 1 │ expect(() => { throw new Error('a'); }).toThrowError();
   ·                                         ────────────
   ╰────
  help: Add an error message to "toThrowError"

  ⚠ eslint-plugin-jest(require-to-throw-message): Require a message for "toThrow".
   ╭─[require_to_throw_message.tsx:4:61]
 3 │                     const throwErrorAsync = async () => { throw new Error('a') };
 4 │                     await expect(throwErrorAsync()).rejects.toThrow();
   ·                                                             ───────
 5 │                     await expect(throwErrorAsync()).rejects.toThrowError();
   ╰────
  help: Add an error message to "toThrow"

  ⚠ eslint-plugin-jest(require-to-throw-message): Require a message for "toThrowError".
   ╭─[require_to_throw_message.tsx:5:61]
 4 │                     await expect(throwErrorAsync()).rejects.toThrow();
 5 │                     await expect(throwErrorAsync()).rejects.toThrowError();
   ·                                                             ────────────
 6 │                 })
   ╰────
  help: Add an error message to "toThrowError"
