Skip to content

Commit

Permalink
Update tests to reflect JS grammar changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbrunsfeld committed Jul 22, 2019
1 parent c0f1f30 commit 298ff59
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/node_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ describe("Node", () => {
assert.equal(bodyNode.constructor.name, 'StatementBlockNode');

const returnNode = bodyNode.namedChildren[0];
assert.deepEqual(returnNode.fields, ['argumentNode'])
assert.equal(returnNode.constructor.name, 'ReturnStatementNode');

const binaryNode = returnNode.argumentNode;
const binaryNode = returnNode.firstNamedChild;
assert.equal(binaryNode.constructor.name, 'BinaryExpressionNode');

assert.equal(binaryNode.leftNode.text, 'c')
Expand Down Expand Up @@ -379,7 +378,7 @@ describe("Node", () => {
const node = tree.rootNode;
assert.equal(
node.toString(),
"(program (expression_statement (parenthesized_expression value: (binary_expression left: (number) right: (MISSING identifier)))))"
"(program (expression_statement (parenthesized_expression (binary_expression left: (number) right: (MISSING identifier)))))"
);

const sum = node.firstChild.firstChild.firstNamedChild;
Expand Down

0 comments on commit 298ff59

Please sign in to comment.