node package manager

karma-trx-reporter

karma-trx-reporter

Reporter for the VisualStudio TRX format.

Status

Branch Status
master Build Status
develop Build Status

Installation

The easiest way is to keep karma-trx-reporter as a devDependency in your package.json.

{
  "devDependencies": {
    "karma": "~0.10",
    "karma-trx-reporter": "~0.1"
  }
}

You can simple do it by:

npm install karma-trx-reporter --save-dev

Configuration

// karma.conf.js 
module.exports = function(config) {
  config.set({
    reporters: ['progress', 'trx'],
 
    // the default configuration 
    trxReporter: { outputFile: 'test-results.trx', shortTestName: false }
  });
};

outputFile

The output file specifies where the trx file will be written.

shortTestName

The trx reporter will attend the browser name to the test name by default. This can be switched off with the shortTestName config property.

You can pass list of reporters as a CLI argument too:

karma start --reporters trx,dots

For more information on Karma see the homepage.