Skip to content

Latest commit

 

History

History
90 lines (56 loc) · 2.83 KB

CONTRIBUTING.md

File metadata and controls

90 lines (56 loc) · 2.83 KB

Contribution Guidelines

Submitting a new issue

If you want to ensure that your issue gets fixed fast you should attempt to reproduce the issue in an isolated example application that you can share.

Making a pull request

If you'd like to submit a pull request please adhere to the following:

  1. Conform to code style defined in JSHint and JSCS configuration files using npm run lint.
  2. Your code must be tested. Please TDD your code using npm run tdd.
  3. Ensure build will pass by running npm run test

See Testing section below for details.

Please note that you must adhere to each of the aforementioned rules. If you update and rebase the pull request to follow the guidelines your pull request will be re-opened and considered for inclusion.

Testing

Tests are written using QUnit, and run by Karma. Code coverage analysis is collected by Istanbul. Static code analysis is performed by JSHint and JSCS. Continuouse Integration testing is powered by Travis CI and Code Climate.

Getting started

  1. Clone this repository:

git clone <repository url>

  1. Install dependencies:

npm install && npm run dependencies

  1. Run tests locally:

npm test

This command runs all the following: - npm run lint - check code style - npm run tdd - run all unit tests in PhantomJS

Multiple tests suites

As you can seen by running npm test, PromiseWindow tests suite is run multiple times, each time in a different enviromnent (AMD, with jQuery loaded, etc).

To know all available environments, run npm run list. Each environment has an associated static HTML file in the tests directory.

When no environment is specified:

  • npm test will run tests in all available environment
  • npm run tdd will run tests in the "native" environment

To run tests in a specific one, set KARMA_ENV environment variable.

CI mode vs developement mode

In continuous integration mode, code coverage is generated. This is not suitable in development mode, because instrumented code generated by code coverage analysis tools is not easy to debug.

  • npm test will run tests in CI mode
  • npm run tdd will run tests in development mode

While this is not recommended, CI mode can be anabled by setting CI environment variable to true.

Debug PhantomJS errors

While using npm run tdd, you can debug PhantomJS errors, by accessing the remote debugger at http://localhost:9000/.