Skip to content

Latest commit

 

History

History
146 lines (104 loc) · 5.88 KB

CONTRIBUTING.md

File metadata and controls

146 lines (104 loc) · 5.88 KB

#Contributing to Jest

We'd love for you to contribute to our source code and to make it even better than it is today! Here are the guidelines we'd like you to follow:

Code of Conduct

Help us keep Jest open and inclusive. Please read and follow our Code of Conduct.

Got a Question or Problem?

Found an Issue?

If you find a bug in the source code or a mistake in the documentation, you can help us by submitting an issue to our GitHub issue tracker. Even better you can submit a Pull Request with a fix.

Want a Feature?

You can request a new feature by submitting an issue to our GitHub issue tracker.

Submission Guidelines

Submitting an Issue

Before you submit your issue search the archive, maybe your question was already answered.

If your issue appears to be a bug, and hasn't been reported, open a new issue. Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues. Providing the following information will increase the chances of your issue being dealt with quickly:

  • Overview of the Issue - if an error is being thrown a stack trace helps
  • Motivation for or Use Case - explain why this is a bug for you
  • Version(s) - is it a regression?
  • Reproduce the Error - provide a live example using a (JUnit) test case or an unambiguous set of steps.
  • Related Issues - has a similar issue been reported before?
  • Suggest a Fix - if you can't fix the bug yourself, perhaps you can point to what might be causing the problem (line of code or commit)

Submitting a Pull Request

Before you submit your pull request consider the following guidelines:

  1. Search GitHub issue tracker for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort.

  2. Fork the project, clone your fork, and configure the remotes:

    # Clone your fork of the repo into the current directory
    git clone https://github.com/<your-username>/Jest.git
    # Navigate to the newly cloned directory
    cd Jest
    # Assign the original repo to a remote called "upstream"
    git remote add upstream https://github.com/searchbox-io/Jest.git
  3. Get the latest changes from upstream:

    git checkout master
    git pull upstream master
  4. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix:

    git checkout -b <topic-branch-name>
  5. Commit your changes in logical chunks. Please adhere to these git commit message guidelines. Use Git's interactive rebase feature to tidy up your commits before making them public.

  6. Locally merge (or rebase) the upstream development branch into your topic branch:

    git pull [--rebase] upstream master
  7. Push your topic branch up to your fork:

    git push origin <topic-branch-name>
  8. Open a Pull Request with a clear title and description against the master branch.

  9. If we suggest changes on your pull request then

  • Make the required updates.

  • Re-run the full test suite to ensure tests are still passing.

  • Rebase your branch and force push to your GitHub repository (this will update your Pull Request):

    git rebase master -i
    git push -f

That's it! Thank you for your contribution!

After your pull request is merged

After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:

  1. Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:

    git push origin --delete <topic-branch-name>
  2. Check out the master branch:

    git checkout master -f
  3. Delete the local branch:

    git branch -D <topic-branch-name>
  4. Update your master with the latest upstream version:

    git pull --ff upstream master

Coding Rules

To ensure consistency throughout the source code, keep these rules in mind as you are working:

  • All features or bug fixes must be unit and integration tested.
  • All public API methods that are not inherently obvious (e.g.: parameters expected in a specific format, usage has a complex pattern, default behaviour may be unexpected, etc.) should have Javadoc.
  • Code style (braces placement, naming convention, error handling, logging, tab-space preference) should follow the general style used in project.
  • Refrain from making breaking changes unless it is discussed and agreed upon.
  • Be extremely cautious when using (or do not use at all) your IDE's auto-formatter. Your commit must not include (auto) cosmetic changes (e.g.: changes on code-block order or statement order, etc.) unless they contribute functionally.