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

gulp-tarte-jsunit

v0.2.1

Published

Unit test tool for Javascript codes working on Node.js.

Downloads

1

Readme

gulp-tarte-jsunit NPM version Build Status

Gulp plugin of tarte-jsunit which is an unit test tool for javascript codes working on Node.js.

tarte-jsunit is a part of js.node package in tarte.sourceforge net project.

Install

Install gulp-tarte-jsunit with npm:

$ npm install --save-dev gulp-tarte-jsunit

Usage

Run an unit test

First, load gulp-tarte-jsunit module in your gulpfile.js.

var gulp = require('gulp');
var jsunit = require('gulp-tarte-jsunit');

Next, write the task to run an unit test like following:

gulp.task('unit', function() {
  jsunit.run('path/of/unit/test/file.js');
});

Here, the above string 'path/of/unit/test/file.js' is a Javascript file path containing an unit test program.

Then, you can run an unit test by a following command:

  $ gulp unit

To output a test result to a json file, specify the file path as follows:

  $ gulp unit --report-file=result.json

Moreover, you can specify a test file via a command line argument, you can use this plugin with lint, and so forth.

The gulpfile.js in this distribution contains a good example for them.

Show a test result with a Web browser

You can show a content of a result json file on a Web browser. Open tarte-jsunit-view.html in this distribution with query string like ?json=result.json.

Write a unit test

The structure of test case tree are as follows:

   testsuite('description about suite', function() {
     this.testcase('description about case', function() {
       this.scene('description about scene', function() {
         ...
           this.scene('description about end level scene', {
             run: function() {
                ... test process ...
         ...

testsuite is the top of the tree and it corresponds to a target class normally. testcase is the second level of the tree and it corresponds to methods of a target class normally. scene is the third level or lower of the tree and it corresponds to a condition or a situation normally.

The tests/test.js in this distribution is a simplified example how to write a unit test code.

License

Copyright (C) 2014 Takayuki Sato.

gulp-tarte-jsunit is free software under MIT License. See the file LICENSE in this distribution for more details.

Dependencies

See the file COPYING_DEPEND.md in this distribution for more details.