Skip to content

Commit

Permalink
refactor(prefer-called-with): rename name data property to `matcher…
Browse files Browse the repository at this point in the history
…Name` (#1178)
  • Loading branch information
G-Rath committed Jul 29, 2022
1 parent 7b7f7bc commit 5934b3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/rules/__tests__/prefer-called-with.test.ts
Expand Up @@ -26,7 +26,7 @@ ruleTester.run('prefer-called-with', rule, {
errors: [
{
messageId: 'preferCalledWith',
data: { name: 'toBeCalled' },
data: { matcherName: 'toBeCalled' },
column: 12,
line: 1,
},
Expand All @@ -37,7 +37,7 @@ ruleTester.run('prefer-called-with', rule, {
errors: [
{
messageId: 'preferCalledWith',
data: { name: 'toBeCalled' },
data: { matcherName: 'toBeCalled' },
column: 21,
line: 1,
},
Expand All @@ -48,7 +48,7 @@ ruleTester.run('prefer-called-with', rule, {
errors: [
{
messageId: 'preferCalledWith',
data: { name: 'toHaveBeenCalled' },
data: { matcherName: 'toHaveBeenCalled' },
column: 12,
line: 1,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/prefer-called-with.ts
Expand Up @@ -15,7 +15,7 @@ export default createRule({
recommended: false,
},
messages: {
preferCalledWith: 'Prefer {{name}}With(/* expected args */)',
preferCalledWith: 'Prefer {{ matcherName }}With(/* expected args */)',
},
type: 'suggestion',
schema: [],
Expand All @@ -40,7 +40,7 @@ export default createRule({

if (['toBeCalled', 'toHaveBeenCalled'].includes(matcher.name)) {
context.report({
data: { name: matcher.name },
data: { matcherName: matcher.name },
messageId: 'preferCalledWith',
node: matcher.node.property,
});
Expand Down

0 comments on commit 5934b3b

Please sign in to comment.