Skip to content
Permalink
Browse files
fix: use range instead of start/end properties (#221)
  • Loading branch information
armano2 authored and SimenB committed Feb 1, 2019
1 parent 47e79c8 commit a3edd2116377ab32b8f550b342fafaeb9aff6f2f
Showing with 4 additions and 4 deletions.
  1. +2 −2 rules/lowercase-name.js
  2. +2 −2 rules/prefer-spy-on.js
@@ -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() +
@@ -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}`
),
];

0 comments on commit a3edd21

Please sign in to comment.