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

grunt-vows-runner

v0.6.0

Published

An alternative test-runner for vows using grunt. Adds new capabilities such as running test suites concurrently.

Downloads

68

Readme

##grunt-vows-runner

A test-runner for vows using grunt.

###Philosophy

File and directory matching, file watching, coverage reporting, etc. should be supplied by third-party tools where possible. Grunt is a great source of such third-party-tools. These are much more likely to continue development than the equivalent tools built into vows, since they are used by many other packages as well.

###Additions

With grunt-vows-runner you can

  • Use grunt tasks and templates.
  • Run suites in the same target concurrently.
  • Set options at the target level.
  • Set the isolate option at the suite and target level, and run isolated and non-isolated suites concurrently.
  • Disable groups of tests at the target level

###Differences from the vows command-line runner

  • Uses grunt to specify which files to run
  • Uses grunt's watch task instead of vows' built-in watch implementation
  • No shuffle option (if you want this, let me know--it is easy to implement)
  • No built-in js-coverage support
  • I highly recommend istanbul, which does not need the cooperation of the test-runner (simply istanbul cover bin/vows will work ); and it is written in javascript, not java

###Installation

  1. Change directories to the root directory of your project
  2. npm install grunt-vows-runner

###Usage

Add the following line to your Gruntfile.js

grunt.loadNpmTasks('grunt-vows-runner');

The vows task is now available; for example

grunt vows

###Configuration

Configuration is placed in the grunt.initConfig section of your Gruntfile.js file in the vows object.

vows is a multitask.

Each target references one or more source files containing suites and may contain options which will be applied to all of those suites.

An example vows configuration with two targets:

...
vows : {
  all : {
    src : "<%= allTests %>",
    options : {
      reporter : "spec"
    }
  },
  allXunit : {
    src : "<%= allTests %>",
    dest : "testResults.xml"
    options : {
      reporter : "xunit"
    }
  }
},
allTests : "tests/*"
...

The example above uses the compact format for specifying files as well as templates.

One destination file (dest) can be specified per target. It will contain the output of all the suites in the target. If no destination file is specified, the output will go to the console.

Paths for both source and destination files are relative to the directory that the Gruntfile.js is in.

Results are summed by target. Grunt-vows-runner doesn't combine the results of multiple targets.

Suites within a target are run concurrently; faster suites will finish first. Targets in grunt are always run sequentially.

####Options

Options can be placed at the task (vows), target, or suite level.

Here is an example of each:

Gruntfile.js (task- and target-level options)

...
vows : {
  options : {
    reporter : "spec"
  },
  most : {
    src : ["test/*", "!test/chattyTests.js"]
  },
  chatty : {
    src : "test/chattyTests.js",
    options : {
      reporter : "silent"
    }
  }
}
...

test/errorTests.js (suite-level options)

...
vows.describe('Error Handling').addBatch({
...
}).export(module, {error : false});
...

The following options are available:

  • error
  • Whether or not vows should handle errors in topics for you. Set error : false if you want to handle your own errors. The first argument to your vows will be reserved for errors.
  • reporter
  • silent, spec, json, tap, xunit, dot-matrix. (Look in vows/lib/vows/reporters for a complete list.)
  • matcher
  • a javascript RegExp object; only run tests whose titles match this object.
  • isolate
  • Run each suite in its own process. This is useful if the system-under-test uses the node process object internally.
  • disabled
  • Temporarily disable tests for a target.

###Command-Line Options

grunt-vows-runner incorporates the following grunt command-line options, if present:

  • --no-color
  • --verbose

###Alternatives

If you would like a grunt plugin that simply forwards options to the existing vows command-line runner, see grunt-vows.