Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 493 Bytes

prefer-hooks-in-order.md

File metadata and controls

30 lines (25 loc) · 493 Bytes

Enforce having hooks in consistent order (vitest/prefer-hooks-in-order)

⚠️ This rule warns in the 🌐 all config.

  // consistent order of hooks
  ['beforeAll', 'beforeEach', 'afterEach', 'afterAll']
  // bad
   afterAll(() => {
		removeMyDatabase();
	});
	beforeAll(() => {
		createMyDatabase();
	});
  // good
   beforeAll(() => {
		createMyDatabase();
	});
	afterAll(() => {
		removeMyDatabase();
	});