Skip to content

Commit

Permalink
fix: use range instead of start/end properties (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 authored and SimenB committed Feb 1, 2019
1 parent 47e79c8 commit a3edd21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rules/lowercase-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ module.exports = {
const description = testDescription(node);

const rangeIgnoringQuotes = [
firstArg.start + 1,
firstArg.end - 1,
firstArg.range[0] + 1,
firstArg.range[1] - 1,
];
const newDescription =
description.substring(0, 1).toLowerCase() +
Expand Down
4 changes: 2 additions & 2 deletions rules/prefer-spy-on.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ module.exports = {
return [
fixer.insertTextBefore(node.left, `jest.spyOn(`),
fixer.replaceTextRange(
[node.left.object.end, node.left.property.start],
[node.left.object.range[1], node.left.property.range[0]],
`, ${leftPropQuote}`
),
fixer.replaceTextRange(
[node.left.property.end, jestFnCall.end],
[node.left.property.range[1], jestFnCall.range[1]],
`${leftPropQuote})${mockImplementation}`
),
];
Expand Down

0 comments on commit a3edd21

Please sign in to comment.