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

utiltest

v0.2.1

Published

Test utils

Downloads

12

Readme

utiltest

utiltest provides functionality for testing, saving time for developing automatic tests.

Install

$ npm install utiltest

Modules

Main

This module provides basic features for test. There the following functions.

testLoader

This function load all the test defined in a specific folder. Any js that doesn't begining by a dot or be a index, will be consider a test file.

'use strict';
var utiltest = require('utiltest'),
  path = require('path');
var fs = require('fs');
describe('dao', function(){
  utiltest.testLoader(path.resolve(__dirname));
});
|-myfolder
||-subfolder
|||-index.js
||-subfolder2
|||-file.js
||-.jshintrc.js
||-anyfile.ext
||-index.js
||-file1.js
||-file2.js

The method will load:

  • file1.js
  • file2.js
  • subfolder/index.js

yadda

This provide basic functionality for using yadda. This module exports a default library and also the necessary methods for create your own library and dictionary.

By default utiltest.yadda provide the basic dictionary with the default steps.

initDictionary

This method return the initial dictionary for creating a new onMessage.

var dictionary = utiltest.yadda.initDictionary;

initLibrary

This method initialize a library. If a dictionary is provided, then the dictionary is automatically add to the library.

var library = utiltest.yadda.initLibrary(dictionary);

Creates a library using a given dictionary.

var library = utiltest.yadda.initLibrary();

Creates a library without a dictionary

addCommonSteps

Add common steps to a given library

var library = utiltest.yadda.addCommonSteps(library);;

Add the common steps to a given library.

Default dictionary.

The default dictionary contains the following terms:

  • json -->> Convert a string to a JSON object

  • strArray -->> convert a string , separate in an array of strings

  • userLogin -->> convert a usser, password in to an object like

    {"user": "string", "password":"string"}
  • statusCode --> convert string in to a number between 100 and 999

Default steps

Launch $json or launch $json: Execute a python script with the given options defined in $json, and wait until the script finish before go to next step.

Given the following context\n$form: Store the given context ($json) in the test context.

Then the response is[\b\n]$json Validates that the response, which is stored in the test context, be equal to $json

Then responses with $type Validates that the response, which is stored in the test context, is of the given type.

Then the response should be like[\s\n]$form Validates that the response, which is stored in the test context, is of the kind defined in $form. See validation.

ScriptLoader

This module provide functionality for loading a script. Initially, only supports python scripts. See jsDoc for more info

validation

This module provide functionality for validation in the tests.

Change Log