There are several ways of contributing to Sinon.JS
- Help improve the documentation published at the Sinon.JS website
- Help someone understand and use Sinon.JS on the the mailing list
- Report an issue, please read instructions below
- Help with triaging the issues. The clearer they are, the more likely they are to be fixed soon.
- Contribute to the code base.
To save everyone time and make it much more likely for your issue to be understood, worked on and resolved quickly, it would help if you're mindful of How to Report Bugs Effectively when pressing the "Submit new issue" button.
As a minimum, please report the following:
- Which environment are you using? Browser? Node? Which version(s)?
- Which version of SinonJS?
- How are you loading SinonJS?
- What other libraries are you using?
- What you expected to happen
- What actually happens
- Describe with code how to reproduce the faulty behaviour
Here's a template for a bug report
Sinon version : Environment : Example URL :
Here's an example use of the template
Sinon version : 1.10.3 Environment : OSX Chrome 37.0.2062.94 Example URL : http://jsbin.com/iyebiWI/8/edit
If
respondWith
called with a URL including query parameter and a function , it doesn't work. This error reported in console.`TypeError: requestUrl.match(...) is null`
Pick an issue to fix, or pitch new features. To avoid wasting your time, please ask for feedback on feature suggestions either with an issue or on the mailing list.
To save everyone some time, please use EditorConfig, so your editor helps make sure we all use the same encoding, indentation, line endings, etc.
The Sinon.JS developer environment requires Node/NPM. Please make sure you have Node installed, and install Sinon's dependencies:
$ npm install
Sinon.JS uses JSCS to keep consistent style. You probably want to install one of their plugins for your editor.
The JSCS test will be run before unit tests in the CI environment, your build will fail if it doesn't pass the style check.
$ npm run lint
To ensure consistent reporting of lint warnings, you should use the same version as CI environment (defined in package.json
)
$ npm test
Some tests needs working XHR to pass. To run the tests over an HTTP server, run
$ node_modules/http-server/bin/http-server
Open localhost:8080/test/sinon.html in a browser.
To test against a built distribution, first make sure you have a build (requires Ruby and Juicer):
$ ./build
If the build script is unable to find Juicer, try
$ ruby -rubygems build
Open localhost:8080/test/sinon-dist.html in a browser.
If you have PhantomJS installed as a global, you can run the test suite in PhantomJS
$ test/phantom/run.sh