Contributing
May 3, 2025 ยท View on GitHub
Thanks for being willing to contribute!
Working on your first Pull Request? You can learn how from this free series How to Contribute to an Open Source Project on GitHub
Project setup
- Fork and clone the repo
$ yarn installto install dependencies$ yarn testto validate you've got it working- Create a branch for your PR
Making changes
- All changes should have unit tests
- Any relevant documentation should be updated
- No linting warnings/errors should be introduced
New Matchers
- Each matcher should be placed in it's own file inside of the
src/matchers/[matcher].ts. - A matcher should:
- Export the matcher in the format expected by Jest. See the docs for an example. Note: the test outcome messages must be a function that returns a string (this caught me out ๐).
- Tests for the matcher should go in
test/matchers/[matcher].test.ts- Test suite that uses the new matcher and make sure it passes. - Docs for the new matcher should be updated in the API section of the
README.mdto no longer sayUnimplemented. - Type definitions for the new matchers should be added to
types/index.d.ts.
Committing and Pushing changes
Once you are ready to commit the changes, please use the below commands
git add <files to be comitted>git commit -m 'A meaningful message
Note: please use present tense in commit messages i.e. Add feature X and not Added feature X
Help needed
Please check out the issues to discuss any of the potential work