Skip to content

Add Jest for testing and add tests for all filters with examples in documentation #469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jChapman
Copy link

@jChapman jChapman commented May 4, 2025

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.

jChapman and others added 3 commits May 3, 2025 22:54
I did not write tests for all filters, some of them were so simple there were no examples in the documentation.

This includes some failing test cases (commented out) in the following filters:

- link
- merge
- split
- table
- wikilink

I was also unable to test map and template because they import debug which imports some polyfill thing that complains about not running in a browser. Can probably fix this through some kind of mocking or injection.
No issues with table now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant