- Install nodejs
(mac
brew install nodejswindowscinst nodejs) - Install jshint and get jshint running in your favorite editor
npm install -g jshint - Install testem
npm install -g testem - install grunt
npm install -g grunt-cli
mkdir -p js-meetup-testing/{src,test} && cd js-meetup-testing- create a .testem file with the following content
{
"framework": "qunit",
"src_files": [
"src/*.js",
"test/**/*-test.js"
]
}
- fire up testem and lets get cooking!
testem
window.helloWorld = function (name) {
return "Hello " + name + "!";
}
test('hello world says hello', function (assert) {
var result = helloWorld('dan');
assert.equal("Hello dan!", result);
});testem launchersto see the list of launchers- include the
launch_in_devkey to identify dev launchers - run
testemand watch the launchers
mkdir vendor && cd vendorcurl http://code.jquery.com/jquery-2.1.0.js -Ocd ..- add
vendor/jquery-2.1.0.jsto the.testem.jsonsrc_files.