Slide 102
Slide 102 text
task 5: test it
Add karma, karma-cil, karma-mocha, karma-chai-
plugins, karma-chrome-launcher, karma-ember-
preprocessor, karma-mocha, karma-phantomjs-
launcher, karma-junit-reporter to package.json
Compile and install PhantomJS
npm install
Install ember-mocha-adapter and chai-jquery via
Bower
Set up a karma.conf file
In your karma.conf:
Customize your frameworks section in karma.conf
to include mocha, chai, sinon-chai, and chai-jquery
Set up a Grunt task to build your Sass on each
test run
Include your vendor dependencies in karma.conf
Include your code in files section
Debug file load order issues
Add & configure handlebars karma preprocessor
Then, create test-helper.js & include it in
karma.conf
In your test-helper.js:
Configure chai and mocha defaults
Set Ember.testing to true
Set App.setupForTesting to true
Call App.injectTestHelpers()
Set up app on each test run
Tear down app after each test run
Ensure beforeEach and afterEach use the run loop
Use the .done() callback for async beforeEach
What we’ll do: