diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-02-09 08:07:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-09 08:07:55 +0000 |
commit | 70551febc8eea1db62ad87aae7bd727ea4a718b6 (patch) | |
tree | 9275a1d8b0dd8ffe27f9e1d2628d3ea8a72501a1 /test/mocha/reduce.js | |
parent | 44499a6643e1aeec260a9b4ddbbebf4f0b3837cc (diff) | |
download | tracifyjs-70551febc8eea1db62ad87aae7bd727ea4a718b6.tar.gz tracifyjs-70551febc8eea1db62ad87aae7bd727ea4a718b6.zip |
improve `test/reduce` (#3710)
- suppress several instances of malformed AST generation
- improve resilience & reporting against malformed ASTs
Diffstat (limited to 'test/mocha/reduce.js')
-rw-r--r-- | test/mocha/reduce.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/mocha/reduce.js b/test/mocha/reduce.js index 99fc7947..5ab4e5b7 100644 --- a/test/mocha/reduce.js +++ b/test/mocha/reduce.js @@ -57,4 +57,10 @@ describe("test/reduce.js", function() { assert.ok(err instanceof Error); assert.strictEqual(err.stack.split(/\n/)[0], "DefaultsError: `unsafe_regex` is not a supported option"); }); + it("Should report on test case with invalid syntax", function() { + var result = reduce_test("var 0 = 1;"); + var err = result.error; + assert.ok(err instanceof Error); + assert.strictEqual(err.stack.split(/\n/)[0], "SyntaxError: Name expected"); + }); }); |