Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 504 Bytes

no-standalone-expect.md

File metadata and controls

33 lines (22 loc) · 504 Bytes

Disallow using expect outside of it or test blocks (vitest/no-standalone-expect)

⚠️ This rule warns in the 🌐 all config.

Rule Details

This rule aims to prevent the use of expect outside of it or test blocks.

Options

{
  "vitest/no-standalone-expect": {
	"additionalTestBlockFunctions": ["test"]
  }
}

example:

// invalid

expect(1).toBe(1)

// valid

it('should be 1', () => {
  expect(1).toBe(1)
})