vitest/no-alias-methods
January 2, 2026 ยท View on GitHub
๐ Disallow alias methods.
โ ๏ธ This rule warns in the ๐ all config.
๐ง This rule is automatically fixable by the --fix CLI option.
Rule Details
This rule disallows alias methods and forces the use of the original method.
Examples of incorrect code for this rule:
expect(a).toBeCalled()
expect(a).toBeCalledTimes(1)
Examples of correct code for this rule:
expect(a).toHaveBeenCalled()
expect(a).toHaveBeenCalledTimes(1)
When Not To Use It
If you don't care about alias methods, you can disable this rule.