diff --git a/lib/binding_web/test/language-test.js b/lib/binding_web/test/language-test.js index dab212d6..394e32b4 100644 --- a/lib/binding_web/test/language-test.js +++ b/lib/binding_web/test/language-test.js @@ -51,14 +51,19 @@ describe("Lookahead iterator", () => { ({ JavaScript, Parser } = await require("./helper")); const parser = new Parser().setLanguage(JavaScript); const tree = parser.parse("function fn() {}"); + parser.delete(); const cursor = tree.walk(); - cursor.gotoFirstChild(); - cursor.gotoFirstChild(); + assert(cursor.gotoFirstChild()); + assert(cursor.gotoFirstChild()); state = cursor.currentNode().nextParseState; lookahead = JavaScript.lookaheadIterator(state); assert.exists(lookahead); }); + after(() => { + lookahead.delete(); + }); + const expected = ["identifier", "comment", "(", "*", "formal_parameters"]; it("should iterate over valid symbols in the state", () => { const symbols = Array.from(lookahead);