Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 403 Bytes

File metadata and controls

33 lines (24 loc) · 403 Bytes

vitest/prefer-hooks-on-top

📝 Enforce having hooks before any test cases.

⚠️ This rule warns in the 🌐 all config.

// bad

describe('foo', () => {
  it('bar', () => {
    // ...
  })

  beforeEach(() => {
    // ...
  })
})

// good

describe('foo', () => {
  beforeEach(() => {
    // ...
  })

  it('bar', () => {
    // ...
  })
})