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

@indigo/node-trx

v0.8.1

Published

File generator utility for TRX file format for use with Visual Studio and MSBuild

Downloads

3

Readme

node-trx

Build Status Coverage Status

This is a Node utility for generating test results files in the Visual Studio Test Results File (TRX) format.

The TRX file format is compliant with the namespace http://microsoft.com/schemas/VisualStudio/TeamTest/2010, found in full spec in %VSINSTALLDIR%\xml\Schemas\vstst.xsd.

This libary is a partial implementation of the XSD.

This library was designed to reduce domain knowledge needed to create TRX files via a simple, fluent interface.

var fs = require('fs')
  , TRX = require('../trx')
  , TestRun = TRX.TestRun
  , UnitTest = TRX.UnitTest
  , computerName = 'bmanci01'
  , run;


run = new TestRun({
    name: 'Sample TRX Import',
    runUser: 'Brian Mancini',
    times: {
        creation: '2015-08-10T00:00:00.000Z',
        queuing: '2015-08-10T00:00:00.000Z',
        start: '2015-08-10T00:00:00.000Z',
        finish: '2015-08-10T00:00:01.500Z'
    }
  })
  .addResult({
    test: new UnitTest({
      name: 'test 1',
      methodName: 'test1',
      methodCodeBase: 'testing-framework',
      methodClassName: 'test1',
      owners: [{name: 'testOwner'}],
      description: 'This is test 1'
    }),
    computerName: computerName,
    outcome: 'Passed',
    duration: '00:00:44.7811567',
    startTime: '2010-11-16T08:48:29.9072393-08:00',
    endTime: '2010-11-16T08:49:16.9694381-08:00'
  })
  .addResult({
    test: new UnitTest({
      name: 'test 2',
      methodName: 'test2',
      methodCodeBase: 'testing-framework',
      methodClassName: 'test2',
      description: 'This is test 2'
    }),
    computerName: computerName,
    outcome: 'Inconclusive',
    duration: '00:00:44.7811567',
    startTime: '2010-11-16T08:48:29.9072393-08:00',
    endTime: '2010-11-16T08:49:16.9694381-08:00'
  })
  .addResult({
    test: new UnitTest({
      name: 'test 3',
      methodName: 'test3',
      methodCodeBase: 'testing-framework',
      methodClassName: 'test3',
      description: 'This is test 3'
    }),
    computerName: computerName,
    outcome: 'Failed',
    duration: '00:00:44.7811567',
    startTime: '2010-11-16T08:48:29.9072393-08:00',
    endTime: '2010-11-16T08:49:16.9694381-08:00',
    output: 'This is sample output for the unit test',
    errorMessage: 'This unit test failed for a bad reason',
    errorStacktrace: 'at test3() in c:\\tests\\test3.js:line 1'
  });


// output the json to the screen
console.log(run);

// write the output to exmample.trx
fs.writeFileSync('example.trx', run.toXml());

Error information can be provided by including errorMessage and errorStacktrace properties in the result. Stacktrace must conform to the syntax at [method signature] in [file path]:[line number] or it will be picked up by Visual Studio.

Standard output information can be included in the output property.

Unit tests

Run npm run test.

Releases

0.8.0 - Added support for Owners, update UUID to 3.0.0

0.7.0 - Added support for Attachments

0.6.0 - Added support for NotExecuted outcome.

0.5.0 - Added support for Pending and Timeout outcomes.

0.4.0 - Added support for configuring Times tag.

0.3.0 - Added support for configuring TestSetting and provides a default if not supplied.

0.2.0 - Added support for Unit Test description

0.1.2 - Added support for errors and stacktrace info

0.1.1 - Initial development release