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

test-studio

v0.1.25

Published

A powerful browser based unit testing user interface.

Downloads

70

Readme

test-studio

test-studio is a powerful web-based front end for node.js unit testing.

For an overview of features, check out this blog post.

Installation

npm install -g test-studio

For debugger support, you also need to install node-inspector.

npm install -g node-inspector

Operation

Starting the test-studio server is as simple as running

test-studio

This starts a web server on port 1678. By default, the current working directory is scanned and monitored recursively for files with an extension of .tests.js.

If your existing suite conforms to mocha defaults, i.e. scan files with an extension of .js in the test folder and use the bdd interface, invoke test-studio with the --mocha, or -m option.

To see test-studio in action, you can run the system tests by passing the --system option.

test-studio can then be accessed by pointing your browser at

http://localhost:1678/

Chrome is required for debugging.

Tests

Currently, test-studio only supports mocha. More frameworks will be added given demand.

The default interface is TDD. This can be set using the --interface option.

suite('math', function () {
    test('add sums arguments', function () {
        var math = require('math');
        expect(math.add(1, 1)).to.equal(2);
    });
});

Various enhancements are available to assist testing.

sinon

Spies, stubs and mocks are available through the sinon psuedo-global variable.

var stub = sinon.stub().returns(42);

See http://sinonjs.org/ for full documentation.

chaijs

The expect and assert functions from the chaijs assertion library are available as psuedo-global variables.

expect(1 + 1).to.equal(2);

assert.equal(1 + 1, 2);

See http://chaijs.com/ for full documentation.

Modules

test-studio provides simple mechanisms for forcing the refresh of modules or providing stubs in place of required modules.

require.refresh('module');
require.refreshAll();

require.stub('module', { /* substitute */ });

Options

--help, -h, -?    Show command line usage options
--run, -r         Run tests in command line mode
--interface, -i   Mocha test API to use ("bdd", "tdd", "exports", etc.)
                                                              [default: "tdd"]
--testPath, -p    Path to test files
--sourcePath, -s  Path to watch for file changes
--filter, -f      Regular expression files must match to be included
                                           [string]  [default: "\.tests\.js$"]
--debugPort       Port to use for debugging                  [default: "5859"]
--inspectorPort   Port to expose node-inspector on (if installed)
                                                             [default: "8081"]
--reporter        Mocha test reporter to use when running in command line mode
                                                              [default: "dot"]
--mocha, -m       Use mocha defaults, i.e. tests from tests/*.js and bdd
                  interface
--system          Run system tests

Issues / Feedback / Contribute

To log a bug, please open a new issue at https://github.com/danderson00/Tribe/issues.

For general feedback or if you're interested in contributing, please drop me a tweet at https://twitter.com/danderson00.

Source

test-studio is built on the tribe platform and is embedded in the server product.

Source for the client side implementation of test-studio is here, the core server side code is here,

License

test-studio is licensed under the MIT License.