Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 387 Bytes

prefer-hooks-on-top.md

File metadata and controls

31 lines (23 loc) · 387 Bytes

Enforce having hooks before any test cases (vitest/prefer-hooks-on-top)

⚠️ This rule warns in the 🌐 all config.

// bad

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

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


// good

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

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