Thanks for being willing to contribute!
Working on your first Pull Request? You can learn how from this little video How to Contribute to an Open Source Projects
- Fork and clone the repo
npm installto install dependenciesnpm run test:watchto validate you've got it working while working!- Create a branch for your PR
- 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 file inside of the
matchersdirectory. - A matcher should export an object with two properties
symmetricandasymmetricwhich should contain the following:symmetricshould contain a function that returns {pass, message} like the Jest API specifies with the same name as the symmetric matcherasymmetric- Should export a class that has same name as asymmetric matcher which:- has the property
$$typeof===Symbol.for("jest.asymmetricMatcher") - its constructor must accept both
expectedandinverse(boolean). - Finally it needs to implement a
asymmetricMatchmethod that receivereceivedarguments and compares and inverses if necessary - Optional but highly recommended:
toAsymmetricMatcherallows the matcher to customize the output that will be displayed - Sadly the above isn't really documented in Jest yet so hopefully this helps out, feel free to message me or open an issue with questions!
- has the property
jest-matchers-utilsis being used for syntax highlighting of error messages.- See the Jest docs for an example usage
lodashis being used for most comparison logic.
Once you are ready to commit the changes, please use the below commands
git add <files to be committed>git commit -m 'A meaningful message