BoilerplateMVC/Backbone-Require-Boilerplate — pull request #39 by betaselam (2013-09-14 05:47:22+00:00)
Title: Updated the boilerplate to include Karma, Istanbul, Plato, CucumberJS an...

Main added features are as follows:

1. In order to run Jasmine unit test from the command line using PhantomJS, I have added the karma configuration. It works nicely with RequireJS and it is configured to run code coverage report using Istanbul. Since it is recommended to install Karma globally, I did not add it to the package.json file. "npm install -g karma@0.10.1" I also configured karma to run with a simple Grunt command "Grunt unit:test". One thing I have not been able to do is configure Karma's test-main.js file (located under public/js/test/ folder) to use the default RequireJS config file similar to specrunner.html.

2. Added Plato via Grunt to provide complexity report. "Grunt complexity:report" creates a reports folder with complexity metrics.

3. For anyone interested in writing acceptance test using Cucumber, I added features folder with a sample feature file written in a gherkin syntax and supporting files. Similar to Karma, CucumberJS can be installed globally using
"npm install -g cucumber@0.3.1" command. Similar to Karma and Plato, Cucumber has been configured to run via a Grunt command: "Grunt acceptance:test".

CucumberJS can be configured to work with different web drivers. This sample uses Selenium WebDriverJS which requires a standalone selenium driver to be running. The driver can be downloaded here: https://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.35.0.jar&can=2&q=
and it can be run using the following simple command: java -jar selenium-server-standalone-2.35.0.jar. Lastly, Chai's assert library is included.

Note:Selenium driver and the BRB site needs to be running in order to run the cucumber test.

I hope you and others will find these additions helpful as I found this Boilerplate. Many thanks! Let me know if you have any question.