Add Jest for testing and add tests for all filters with examples in documentation #469
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.
Found some examples in the documentation that didn't match up with what I was seeing when actually using clipper, so I decided to try and add some tests that at least covered those cases. Also because it would give me some confidence that I wasn't breaking things when I started making/submitting changes.
Let me know if you have opinions on where the tests should live (there are already quite a few files in the src/utils/filters dir).
I also considered making these tests at a higher level (so it could go through w/e other forms of parsing and cleanup happen), but it wasn't that easy to do, so I ended up just testing the filters themselves.
Some of the test cases I've commented out as failures might come from me not understanding the docs or skipping some part of the parsing.