Skip to content

Jest results processor for exporting into TRX files for Visual Studio

License

Notifications You must be signed in to change notification settings

ElasticPencil/jest-trx-results-processor

 
 

Repository files navigation

build status npm version Dependency Status Commitizen friendly semantic-release

jest-trx-results-processor

This package is used to export a TRX file from Jest test runs to be used in Visual Studio and Visual Studio Team Services.

Usage

First install the package to your project from npm as a devDependency:

npm install jest-trx-results-processor --save-dev

or if you prefer yarn:

yarn add --dev jest-trx-results-processor

Then create a jestTrxProcessor.js file somewhere in your project (for this example I'll assume the scripts folder). There you can configure the processor, as Jest does not allow you to pass custom parameters to the results processor:

var builder = require('jest-trx-results-processor');

var processor = builder({
    outputFile: 'relative/path/to/resulting.trx' // this defaults to "test-results.trx"
});

module.exports = processor;

Finally point Jest to your results processor in the package.json:

{
  "devDependencies": {
    "jest": "^19.0.0",
    "jest-trx-results-processor": "~0.0.5",
  },
  "jest": {
    "testResultsProcessor": "./scripts/jestTrxProcessor"
  }
}

Then you just run Jest as you normally would.

Minimal working configuration can be seen in the examples folder.

Acknowledgements

This tool is heavily inspired by karma-trx-reporter.

License

jest-trx-results-processor is available under MIT. See LICENSE for more details.

About

Jest results processor for exporting into TRX files for Visual Studio

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%