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

mstest

v0.2.2

Published

Provides an interface for the mstest command line utility

Downloads

1,522

Readme

mstest

Provides an interface for MSTest and parses test output.

Install

npm install mstest

Usage Example

var MSTest = require('mstest');

var msTest = new MSTest();
msTest.testContainer = '/path/to/test.dll';
msTest.details.errorMessage = true;
msTest.details.errorStackTrace = true;
msTest.runTests({
    eachTest: function(test) {
        console.log(test.status + ' - ' + test.name);
    },
    done: function(results, passed, failed) {
        console.log(passed.length + '/' + results.length);
    }
});

API

new MSTest()

Properties

  • string exePath: Path to mstest.exe
  • string workingDir: Directory to execute the tests from
  • bool noIsolation: (Default: false) If true, tests will run within the MSTest.exe process
  • string testSettings: Path to a test settings file
  • string runConfig: Path to a run configuration file
  • string resultsFile: Where to save the results
  • bool debugLog: (Default: false) If true, will print out simple debug messages to stdout
  • bool useStdErr: (Default: false) If true, mstest will output its error messages to stderr instead of stdout, which can be caught and handled with the options.error callback of runTests()
  • string language: (Default: "en") if mstest.exe is non-english, choose another language from localization.json
  • object details: Each key that is set to true will be treated as an additional detail. Keys are converted to lowercase when processing. See Microsoft's MSTest.exe Command-Line Options for a list of any valid details. Below is listed some examples
    • bool duration
    • bool errorMessage/errormessage
    • bool errorStackTrace/errorstacktrace

Methods

All methods support chaining

  • addTestList( string testList ): Adds a new test list option

  • removeTestList( string testList ): Removes a test list option

  • clearTestLists(): Removes all test list options

  • setCategory( string category ): Sets the category option. Allow logical operators will do this if no other categories are set

  • andCategory( string category ): Adds another category using "and" (i.e. ...&category)

  • orCategory( string category ): Adds another category using "or" (i.e. ...|category)

  • notCategory( string category ): Adds another category using "not" (i.e. ...!category)

  • andNotCategory( string category ): Adds another category using "and not" (i.e. ...&!category)

  • removeCategory( string category ): Removes a previously added category. Uses notCategory to blacklist a category

  • addTest( string test ): Adds a test case filter

  • removeTest( string test ): Removes a test case filter

  • clearTests(): Clears all test case filters

  • publish( object options ): Prepares the tests to be published to a TFS server

    • string options.server: TFS server (i.e. http://TFSMachine:8080)
    • string options.buildName: Name of the build. See /publishbuild for how to find this value
    • string options.flavor: Must match the value set in the build (i.e. debug, release, etc.)
    • string options.platform: Must match the value set in the build (i.e. AnyCPU, x86, etc.)
    • string options.teamProject: Name of the team project the build belongs to
    • string [options.resultsFile]: (Optional) Name of the results file to publish. Only set when publishing previous test results
  • dontPublish(): Clears any publish settings

  • runTests( object [options] ): Runs the tests with the current settings

    • function( TestResult ) [options.eachTest]: Called after each test is completed
    • function( TestResult[] results, TestResult[] passed, TestResult[] failed ) [options.done]: Called after all of the tests have run
    • function( * ) [options.error]: Called when an error happens