diff --git a/rules/lowercase-name.js b/rules/lowercase-name.js index b577ff03d..84b8748b5 100644 --- a/rules/lowercase-name.js +++ b/rules/lowercase-name.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() + diff --git a/rules/prefer-spy-on.js b/rules/prefer-spy-on.js index c6ab97f96..ad00a413f 100644 --- a/rules/prefer-spy-on.js +++ b/rules/prefer-spy-on.js @@ -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}` ), ];