Fixed another queryAst test

There were 2 problems:
 - Test was looking for the old style of `line` call to choose an offset
   for pathToNode
 - Test assumed that the `tag` param was always the third one, but in
   a kwarg call, you have to look it up by label
This commit is contained in:
Adam Chalmers
2025-01-14 11:36:15 -06:00
committed by Nick Cameron
parent ff71250d5d
commit ae0860a775
2 changed files with 15 additions and 13 deletions

View File

@ -443,7 +443,7 @@ describe('Testing findUsesOfTagInPipe', () => {
it('finds the current segment', async () => {
const ast = assertParse(exampleCode)
const lineOfInterest = `198.85], %, $seg01`
const lineOfInterest = `198.85], tag = $seg01`
const characterIndex =
exampleCode.indexOf(lineOfInterest) + lineOfInterest.length
const pathToNode = getNodePathFromSourceRange(