assertASTsAreEqual
: don't depend on Chai
#78
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses the need not to depend on chai in
assertASTsAreEqual
, as per #35.While pondering the changes I've made I gave a look at the coverage for
assertASTsAreEqual
and found out that there are two branches not covered, while being not particularly fond of 100% coverage per se I still think it gives some useful insights.First unconvered branch is the right side of this expression, I could not find a suitable test input that could lead there, my hunch is that it's related to this
any
: I believe that if we could express all types involved then the type checker could do the heavy lifting for us looking for pattern matching exhaustiveness.Second one is this , and it too, I believe, is related to the above
any
.I've looked around and I've seen that
value
of typeFeatureDescription
is being used asReferenceByName
Node[]
or as aNode
, in the two above branchesNode[]
orNode
At this point I would ask a colleague for guidance, showing my findings, to discuss if and how to progress this.
General notes
it.only
anddescribe.only
only if focusing on the file they're used (because tests run in parallel); if you're interested I could submit a PR that allows to filter tests, unless I'm missing something crucial in the development process