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 🙏

© 2025 – Pkg Stats / Ryan Hefner

rinuts-nodeunitDriver

v0.0.3

Published

A nodeunit driver using rinuts. Enumerates and runs single nodeunit tests

Readme

rinuts-nodeunitDriver

  • Exposes nodeunit based tests through a RESTful api using rinuts, allowing to remotely query for the urls of supported tests and to activate them, receiving a detailed test run summary.

  • Fully supports nodeunit structured tests, testcases and groups.

  • Supports loading of 1. complete folders including subfolders for all contained test files 2. specific files 3. test modules objects (this allows one to consume a test module from another service);

built on node and nodeunit

Installation

Install with [npm](http://github.com/isaacs/npm):

    $ npm install rinuts		 

Usage

Starting the service:

var path = require('path'),
    rinuts = require('rinuts-nodeunitDriver');

rinuts.listen([path.resolve('/tests/testFolder'), path.resolve('../tests/testSuite1.js'), require('../testSuite2')], 9999);

important note

The name of the tests contained in modules introduced to this driver must differ from one another, otherwise they will overlap.
Tests orginized in groups will have their containing group name appended prior to the test name, e.g:
{
	groupA: {
		test1: function(test){
			...
			}
	}
}

will be reffered to by the driver as 'groupA.test1'.
Thus having the following module included with the module above is O.K by naming: 
{
	groupB: {
		test1: function(test){
			...
			}
	}
}	

Service API:

* listen(modules, port)
    Loads 'modules' and starts listening for requests on 'port'. 
    [Argument] port - string specifying the port number to listen on.
    [Argument] modules - any of the following : a nodeunit module | a path to nodeunit file | 
          a path to a directory (includes subdirs) | an array containing any of the previous.

HTTP exposed API:

*	GET /tests : JSON response with a list of the tests exposed. Each test includes it's unique name and a POST URL which can be used to execute it. The list structure is as follows:
        {
            "*moduleName_testName*": {
                "name": "*testName*",                    
                "url":"/tests/*moduleName*/*testName*"
                }
            ...
        }

*	GET /tests/:testName : Returns an individual entry from the list above. has the form of:
		{
			"name": "*testName*",				
			"url": "/tests/*moduleName*/*testName*"}

*	POST /tests/:testName : Executes the individual test and returns the test run summary, including stdout/err capture, in the following structure:            
        {
            "name": *testName*,
            "duration": *in milliseconds*,
            "state": *true|false*,
            "assertions": [{  
                            "method": *ok | fail etc...*
                            "success": *true|false*,             
                            "message": *assertion message*, // included only for failed tests
                            "stack": *stack trace*, // included only for failed tests					
                        }, 
                        ...
                        ]		
        }
		
	Adding context to the request(Optional):		
		HTTP-Headers: "Content-Type: application/json"
		HTTP-Body: *context* - a JSON notated object
		
		context has the following form: "{"context": *whatEver* }"
	
	* context is reachable in any nodeunit based test through the 'test' argument, e.g,
	TestSuite.js :
		exports.contextEqualNumbers = function(test){
			var num1 = 10,
				num2 = test.context.num2;
				
			test.ok(num1 === num2);
			test.done();
		}