vitest/max-expects
@vitest/eslint-plugin
No autofix
eslint.config.js
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/max-expects": "error",
},
},
];test('foo', () => {
expect(1).toBe(1)
expect(2).toBe(2)
})test('foo', () => {
expect(1).toBe(1)
})Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
vitest/max-expects
@vitest/eslint-plugin
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/max-expects": "error",
},
},
];vitest/max-expects
vitest plugin · style
{
"plugins": [
"vitest"
],
"rules": {
"vitest/max-expects": "error"
}
}Biome does not have this rule.
Enforces a maximum number assertion calls in a test body
Enforce hoisted APIs to be on top of the file