This project is an example of how to approach continuous integration by running QUnit tests inside a headless browser (Chrome) and/or inside Node.js.
Clone or fork this repository and be sure to run the following two commands to install the dependencies and start the first test run:
npm install
npm test
Travis CI provides cloud-based Continuous integration for open source projects on GitHub. After you enable it, Travis CI will automatically run the tests and report back whenever you git push
,
or submit a pull-request.
This boilerplate repository has Travis enabled (view build history).
Just get into it, have a look at it all, you'll get the hang of it, it's easy! If you've got any problems, feel free to ask on Twitter or file an issue.
By default, Travis-CI will execute the npm test
command, which in this example
repository runs grunt test
and node test/node-index.js
. The Gruntfile takes care
of running ESLint and running the QUnit tests in Headless Chrome.
The second script runs the unit tests in Node.js (without a browser environment).
Depending on the kind of project you have you may want to keep only one of these.
If your application only runs in a browser:
- Remove
test/node-test.js
- Remove the
qunit test/node-index.js
command fromscripts.test
inpackage.json
If your app is written specifically for Node.js only, then:
- Remove
karma.conf.js
- Remove the
karma-debug
run script frompackage.json
- Remove
karma
andkarma-*
from thedevDependencies
inpackage.json