Karma - JS Test Runner

Karma - JS Test Runner

Talk given at MelbJS - August 2013

A32ee5b05bff6b42a3dd62b5732065f8?s=128

Sebastiano Armeli-Battana

August 14, 2013
Tweet

Transcript

  1. 12.
  2. 16.
  3. 17.

    Domain Specific Language (DSL) for defining tests npm install -g

    karma karma init karma start // Karma starts listening
  4. 18.

    Domain Specific Language (DSL) for defining tests npm install -g

    karma karma init karma start karma run // Karma runs the tests
  5. 19.

    module.exports = function(config) { config.set({ basePath: './../..', frameworks: ['jasmine', ‘requirejs’],

    files: [ ‘spec/javascripts/test-main.js’, {pattern: 'spec/javascripts/fixtures/**/*.html', watched: false}, {pattern: 'app/assets/javascripts/**/*.js'}, {pattern: 'spec/javascripts/**/*.js'} ], port: 9876, //default browsers: ['Chrome’, ‘ChromeCanary’], singleRun: false, autoWatch: true }); }
  6. 25.

    karma-junit-reporter karma-coverage reporters: [‘junit’], junitReporter : { outputFile: 'test-reports.xml', suite:

    'My Suite' } reporters: [‘coverage’], coverageReporter: { type : 'html', dir : 'coverage/' }
  7. 34.