Skip to content

Commit 6629da5

Browse files
authored
fix(no-alias-methods): reverse toThrow/toThrowError alias direction (#881)
1 parent c3e4754 commit 6629da5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/rules/no-alias-methods.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
3737
toReturnWith: 'toHaveReturnedWith',
3838
lastReturnedWith: 'toHaveLastReturnedWith',
3939
nthReturnedWith: 'toHaveNthReturnedWith',
40-
toThrow: 'toThrowError',
40+
toThrowError: 'toThrow',
4141
}
4242

4343
return {

tests/no-alias-methods.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ruleTester.run(rule.name, rule, {
1313
'expect(a).toHaveReturnedWith()',
1414
'expect(a).toHaveLastReturnedWith()',
1515
'expect(a).toHaveNthReturnedWith()',
16-
'expect(a).toThrowError()',
16+
'expect(a).toThrow()',
1717
'expect(a).rejects;',
1818
'expect(a);',
1919
],
@@ -49,14 +49,14 @@ ruleTester.run(rule.name, rule, {
4949
],
5050
},
5151
{
52-
code: 'expect(a).not["toThrow"]()',
53-
output: "expect(a).not['toThrowError']()",
52+
code: 'expect(a).not["toThrowError"]()',
53+
output: "expect(a).not['toThrow']()",
5454
errors: [
5555
{
5656
messageId: 'noAliasMethods',
5757
data: {
58-
alias: 'toThrow',
59-
canonical: 'toThrowError',
58+
alias: 'toThrowError',
59+
canonical: 'toThrow',
6060
},
6161
column: 15,
6262
line: 1,

0 commit comments

Comments
 (0)