MCPcopy Index your code
hub / github.com/autoNumeric/autoNumeric / testParser

Function testParser

test/unit/autoNumeric.spec.js:9014–9019  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

9012
9013 it(`should correctly parse the math expressions`, () => {
9014 function testParser(text) {
9015 const ast = new Parser(text);
9016 const result = (new Evaluator()).evaluate(ast);
9017
9018 return Number(result);
9019 }
9020
9021 expect(testParser('2 + 6')).toEqual(8);
9022 expect(testParser('2 - 6')).toEqual(-4);

Callers 1

Calls 1

evaluateMethod · 0.80

Tested by

no test coverage detected