vitest/no-test-return-statement
January 2, 2026 ยท View on GitHub
๐ Disallow return statements in tests.
โ ๏ธ This rule warns in the ๐ all config.
Rule Details
incorrect code for this rule:
import { test } from 'vitest'
test('foo', () => {
return expect(1).toBe(1)
})
correct code for this rule:
import { test } from 'vitest'
test('foo', () => {
expect(1).toBe(1)
})