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
- Fork and clone the repo
$ yarn install
to install dependencies$ yarn test
to validate you've got it working- Create a branch for your PR
Head over to here to signup if you haven't already
- All changes should have unit tests
- Any relevant documentation should be updated
- No linting warnings/errors should be introduced
- Each matcher should be placed in it's own directory inside of the
matchers
directory. - A matcher directory should contain the following:
index.js
- An export of 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 😉).index.test.js
- Test suite that uses the new matcher and make sure it passes.predicate.js
- The function that tests the actual value meets the expected value / behavior.predicate.test.js
- Tests for the predicate both true/false cases must be covered.
jest-matchers-utils
is being used for syntax highlighting of error messages.- See the Jest docs for an example usage
- Jest's
expect
package is being used to access their deepequals
function.import { equals } from 'expect/build/jasmine_utils';
- Docs for the new matcher should be updated in the API section of the
README.md
to no longer sayUnimplemented
. - Type definitions for the new matchers should be added to
types/index.d.ts
.
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
This project follows the all contributors
specification. To add yourself to the table of contributors on the README.md
, please use
the automated script as part of your PR:
yarn contributor <YOUR_GITHUB_USERNAME>
Follow the prompt. If you've already added yourself to the list and are making a
new type of contribution, you can run it again and select the added contribution
type. If you need to edit the .all-contributorsrc
file by hand that's fine
too, just run yarn contributor:gen
to regenerate the table
Please checkout the ROADMAP and raise an issue to discuss any of the items