glayzzle / php-parser

:herb: NodeJS PHP Parser - extract AST or tokens
https://php-parser.glayzzle.com/
BSD 3-Clause "New" or "Revised" License
532 stars 71 forks source link

Cover strictly 100% of the code #49

Open ichiriac opened 7 years ago

ichiriac commented 7 years ago

Improve the coverage with mocha :

cseufert commented 3 years ago

There are a lot of branches that are not straightforward to test, as the branch will not be exercised unless the mode is changed from error to warning (for the expect() functions, and random AST nodes are removed to trigger all these cases (lots of expected brackets, arrows, etc). I wonder if writing a test driver that drops each symbol in each test, and takes a snapshot of the output would work here?