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

wTesting

v1.0.588

Published

Framework for convenient unit testing. Testing provides the intuitive interface, simple tests structure, asynchronous code handling mechanism, colorful report, verbosity control and more. Use the module to get free of routines which can be automated.

Downloads

956

Readme

utility::Testing status stable

Framework for convenient unit testing. Utility Testing provides the intuitive interface, simple tests structure, asynchronous code handling mechanism, colorful report, verbosity control and more. Use the module to get free of routines which can be automated.

Why wTesting?

  • Simple test syntax
  • Simple grouping of test cases
  • Running of group of test suites and running of separate test suite
  • Testing of separate routines
  • Colorful report
  • Verbosity control
  • Enhanced test checks messages
  • Displaying code of test case in report
  • Async function support
  • Abstract test suites
  • Runs tests concurrently

Installation

To install :

npm install -g wTesting@stable

Test files

Name of test file should has the suffix .test so that the testing utility could find and run it. Create a test file First.test.js in any project directory

require( 'wTesting' );

function myTest( test )
{
  /* describe what is going to happen */
  test.case = 'info about test case';

  /* do it and save results */
  var got = 'abc'.indexOf( 'a' );
  var expected = 0;

  /* compare result with expected */
  test.identical( got, expected );
}

/*
Map that describes test suit, contains
- name of the suit,
- map of test routines
- and other options
*/

var testSuite =
{
  name : 'name of my test suit',
  tests :
  {
      myTest : myTest
  }
}

/* Initilize test suit */
testSuite = wTestSuite( testSuite );

/* Run all tests of the suit */
wTester.test( testSuite.name );

Running tests

tst .run ./someDirectory

Running all test suites in directory by utility Testing. To run file First.test.js run command tst .run ./ in directory of file.

tst .run ./path/to/suite

Running of separate test suite by utility Testing.

node ./path/to/suite

Running of separate test suite by NodeJS directly.

Running options

Utility provides more control of testing process by running options. It is control parameters of the testing that is passed to the run command.

tst .run ./someDirectory verbosity:5

Option verbosity - change amount of output test information. Accepts a value from 0 to 9. Default value is 4.

tst .run ./path/to/suite routine:someRoutine

Option routine - used to test separate test routine. Accepts name of test routine.

tst .run ./someDirectory testRoutineTimeOut:10000

Option testRoutineTimeOut - limits the testing time for test routines. Accepts time in milliseconds. Default value is 5000ms.

Documentation

Please see documentation in the doc directory.

For gentle introduction use tutorials. For getting exhaustive information on one or another aspect use list of concepts to find a concept of interest and get familiar with it.

Cheat sheet

All information about utility in short form given in cheat sheet.

Quick references