0.3.1 • Published 9 years ago

karma-mocha-extended v0.3.1

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

karma-mocha-extended

Extends the karma-mocha Adapter for the Mocha testing framework.

This Adapter does everything that karma-mocha does with one major difference - it exposes Mocha style test results at the server level when running Karma programmatically. See implementation details here

Example

var Karma = require('karma').Server;
var config = {
  port: 9876,
  frameworks: ['mocha'], // no, not 'mocha-extended'
  files: [
    'src/**/*.js'
    'test/**/*.js'
  ],
  singleRun: true
}

var karma = new Karma(config, function(exitCode) {
  // This callback gets invoked just before process.exit
});

karma.on('browser_complete', function(browser, result) {
  // access to the result.mochaResults property!
  // mochaResults are formatted just like they would be from their own reporter
  // danthareja/mocha-js-reporter handles this formatting
})

karma.start(); // Run

// More on running Karma programatically:
// http://karma-runner.github.io/0.13/dev/public-api.html

Regular Use

See https://github.com/karma-runner/karma-mocha for how to use this as a regular framework