Skip to content

Contributing

sethkinast edited this page Nov 12, 2014 · 2 revisions

Open https://github.com/linkedin/dustjs-helpers in a browser and fork it. Then clone your fork:

    git clone https://github.com/<your github account>/dustjs-helpers dustjs-helpers
    cd dustjs-helpers

Set up a branch for what you are working on

    git checkout -b myBranchName

Install grunt-cli to run grunt commands. For more information see http://gruntjs.com/getting-started

    npm install -g grunt-cli

Install the project's dependencies

    npm install

Make your changes on the branch and run tests to make sure changes are OK

    grunt test

Commit your changes and push them to GitHub

    git add .
    git commit -m "My changes to dustjs-helpers repo"
    git push origin myBranchName

Go to GitHub and post a pull request. See https://help.github.com/articles/creating-a-pull-request

Debugging

To debug code in a browser run grunt dev. The tests will be served from http://localhost:3000/_SpecRunner.html.

The tests are run using unminified dust-helpers.js and dust-full.js files. This will allow you to easily step through the code and set up breakpoints.

This task also watches for changes to lib directory, so you can simply refresh the page to see the changes without needing to re-run grunt dev task.

Using watch

grunt watch will monitor dust-helpers.js and test spec files. Whenever a change is made to those files, it will jshint them and run unit tests in Phantom (will not run them in node or rhino). It is a handy way to keep testing your changes without a need to manually run grunt testPhantom task.

Be sure to run grunt test before sending your pull request. It will test your change in all environments and make sure that a Travis build for your pull request succeeds.

Testing minified code in browser

Use grunt testClient to test prod version code in any browser. Similarly to the grunt dev task, it will host the tests at http://localhost:3000/_SpecRunner.html

Coverage report

grunt coverage runs Jasmine unit tests and generates a coverage report under tmp/coverage folder. Open index.html in a browser to view the coverage.

Clone this wiki locally