Contributions are always welcome, no matter how large or small. Before contributing, please read the code of conduct.
There are two areas you can contribute to:
- As part of your open source training.
- Making the overall mentorship content better.
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 Circle 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 Circle 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.
If you are making changes to the website or documentation, test the website folder and run the server to check if your changes are being displayed accurately.
- Locate to the website directory and install any website specific dependencies
by typing in
yarn
. Following steps are to be followed for this purpose from the root directory.cd website yarn
- You can run a development server to check if the changes you made are being
displayed accurately by running
yarn start
in the website directory.
In order to accept a pull request for improving the training content, we need you to submit a CLA. You only need to do this once to work on any of Facebook's open source projects.
Complete your CLA here: https://code.facebook.com/cla
By contributing to this project, you agree that your contributions will be licensed under its MIT license.