Skip to content

Commit a3edd21

Browse files
armano2SimenB
authored andcommitted
fix: use range instead of start/end properties (#221)
1 parent 47e79c8 commit a3edd21

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

rules/lowercase-name.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ module.exports = {
7878
const description = testDescription(node);
7979

8080
const rangeIgnoringQuotes = [
81-
firstArg.start + 1,
82-
firstArg.end - 1,
81+
firstArg.range[0] + 1,
82+
firstArg.range[1] - 1,
8383
];
8484
const newDescription =
8585
description.substring(0, 1).toLowerCase() +

rules/prefer-spy-on.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ module.exports = {
5353
return [
5454
fixer.insertTextBefore(node.left, `jest.spyOn(`),
5555
fixer.replaceTextRange(
56-
[node.left.object.end, node.left.property.start],
56+
[node.left.object.range[1], node.left.property.range[0]],
5757
`, ${leftPropQuote}`
5858
),
5959
fixer.replaceTextRange(
60-
[node.left.property.end, jestFnCall.end],
60+
[node.left.property.range[1], jestFnCall.range[1]],
6161
`${leftPropQuote})${mockImplementation}`
6262
),
6363
];

0 commit comments

Comments
 (0)