---
source: crates/oxc_linter/src/tester.rs
expression: no_standalone_expect
---
  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:1:1]
 1 │ (() => {})('testing', () => expect(true).toBe(false))
   ·                             ──────
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:1:1]
 1 │ expect.hasAssertions()
   · ──────
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:1:1]
 1 │ expect().hasAssertions()
   · ──────
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:3:1]
 3 │                     const t = Math.random() ? it.only : it;
 4 │                     t('testing', () => expect(true).toBe(false));
   ·                                        ──────
 5 │                 });
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:3:1]
 3 │                     const t = Math.random() ? it.only : it;
 4 │                     t('testing', () => expect(true).toBe(false));
   ·                                        ──────
 5 │                 });
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:6:1]
 6 │                 ]).test('returns the result of adding %d to %d', (a, b, expected) => {
 7 │                     expect(a + b).toBe(expected);
   ·                     ──────
 8 │                 });
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:6:1]
 6 │                 ]).test('returns the result of adding %d to %d', (a, b, expected) => {
 7 │                     expect(a + b).toBe(expected);
   ·                     ──────
 8 │                 });
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:6:1]
 6 │                 ]).test('returns the result of adding %d to %d', (a, b, expected) => {
 7 │                     expect(a + b).toBe(expected);
   ·                     ──────
 8 │                 });
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:1:1]
 1 │ describe('a test', () => { expect(1).toBe(1); });
   ·                            ──────
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:1:1]
 1 │ describe('a test', () => expect(1).toBe(1));
   ·                          ──────
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:1:1]
 1 │ describe('a test', () => { const func = () => { expect(1).toBe(1); }; expect(1).toBe(1); });
   ·                                                                       ──────
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:1:1]
 1 │ describe('a test', () => {  it(() => { expect(1).toBe(1); }); expect(1).toBe(1); });
   ·                                                               ──────
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:1:1]
 1 │ expect(1).toBe(1);
   · ──────
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:1:1]
 1 │ {expect(1).toBe(1)}
   ·  ──────
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:1:1]
 1 │ it.each([1, true])('trues', value => { expect(value).toBe(true); }); expect(1).toBe(1);
   ·                                                                      ──────
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:1:1]
 1 │ describe.each([1, true])('trues', value => { expect(value).toBe(true); });
   ·                                              ──────
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:2:1]
 2 │                 import { expect as pleaseExpect } from '@jest/globals';
 3 │                 describe('a test', () => { pleaseExpect(1).toBe(1); });
   ·                                            ────────────
 4 │             
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?

  ⚠ eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.
   ╭─[no_standalone_expect.tsx:2:1]
 2 │                 import { expect as pleaseExpect } from '@jest/globals';
 3 │                 beforeEach(() => pleaseExpect.hasAssertions());
   ·                                  ────────────
 4 │             
   ╰────
  help: Did you forget to wrap `expect` in a `test` or `it` block?


