Contributions are always welcome, no matter how large or small. Before contributing, please read the code of conduct.
We actively welcome your pull requests.
- Fork the repo and create your branch from
master
. - If you've added code that should be tested, add tests and make sure the test suite passes.
- If you've made documentation fixes, we love you!
- Ensure tests pass on Travis CI.
If you make code changes, we expect you to detail how you tested the changes when your submit the pull request.
You can send a link to a JSFiddle where you show a working test. Here's an example fiddle showing sum functionality.
If you add new functionality, we expect you to add a new test in the js/__tests__
folder. These are Jest tests. See existing tests as examples.
If you're not familiar with Jest, and/or you aren't ready to install it, just add a test anyway. The continuous integration tests (via Travis CI) will run to check this. If your tests fail, the PR will not be accepted.
Alternatively, you can set up Jest and get brownie points for mentioning in the pull request that you've run the local test suite.
Jest testing setup
You only need to do the following one time:
- Install Brew
- Install Node
brew install node
- Install Watchman
brew install watchman
- Install Yarn
npm install -g yarn
Go to the top-level folder for this repository on your machine and run the following command:
yarn install
Running Jest tests
In your top-level folder, run the following whenever you want to test your changes:
yarn test
You should see something similar to the following:
$ yarn test
Using globally installed version of Yarn
yarn test v0.21.2
$ jest
PASS js/__tests__/sum.test.js
✓ adds 1 + 2 to equal 3 (2ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.816s, estimated 1s
Ran all test suites.
✨ Done in 1.68s.
Expect to see more tests listed as more tests are added.
By contributing to this project, you agree that your contributions will be licensed under its MIT license.