npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jest-trx-results-processor

v3.0.2

Published

Jest results processor for exporting into TRX files for Visual Studio

Downloads

85,455

Readme

Node.js CI 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.

Migration from 0.x

Version 1.0.0 was rewritten to use reporters API. Either use that (see Usage), or update the require path in your configuration (see Usage as testResultsProcessor).

Installation

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

Usage

In your jest config add the following entry:

{
  "reporters": ["default", "jest-trx-results-processor"]
}

You can also pass additional arguments:

{
  "reporters": [
    "default",
    [
      "jest-trx-results-processor",
      {
        "outputFile": "relative/path/to/resulting.trx", // defaults to "test-results.trx"
        "defaultUserName": "user name to use if automatic detection fails" // defaults to "anonymous"
      }
    ]
  ]
}

Then run jest as usual.

Usage as testResultsProcessor

Notice: this method of use will be removed in the next major version. Please use the reporters API described above.

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:

// for jest-trx-results-processor >= 1.0.0
var builder = require("jest-trx-results-processor/dist/testResultsProcessor"); // only this has changed since v 0.x
// for jest-trx-results-processor < 1.0.0
var builder = require("jest-trx-results-processor");

var processor = builder({
  outputFile: "relative/path/to/resulting.trx", // this defaults to "test-results.trx"
  defaultUserName: "user name to use if automatic detection fails", // this defaults to "anonymous"
});

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 and jest-junit.

License

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