Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 441 Bytes

prefer-hooks-in-order.md

File metadata and controls

29 lines (24 loc) · 441 Bytes

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

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