0.2.1 • Published 9 years ago

antr v0.2.1

Weekly downloads
36
License
-
Repository
github
Last release
9 years ago

antr

Asynchronous Node Test Runner

Build Status

Why?

We had the need for a runner which runs tests asynchronously.

Install

npm install antr

Usage

Just require the module and you're away!

var Antr = require('antr');

var run = new Antr({
	dirname: __dirname,
	filter: /test([^\/w]+?)\.js$/
});

You can pass a callback in as the second parameter if you like, which will callback with err, stats. If you don't give antr a callback it will quit the process for you.

var Antr = require('antr');

var run = new Antr({
	dirname: __dirname,
	filter: /test([^\/w]+?)\.js$/
}, function(err, stats){
	console.log('Tests failed: ', stats.failed);
});

Stats contains

  • passed
  • failed
  • total
  • failRate - percentage of failed tests
  • failedTests - array of file paths
  • passedTests - array of file paths
  • timeTaken - format hh:mm:ss

Options

Required

  • filter Regex to filter files to run

Optional

  • dirname Directory to find files in - defaults to . This can be an array of directories
  • listFiles Print out the array of files which will be run - defaults to false
  • timeout A timeout, in seconds, for each test - defaults to 30
  • batchSize Maximum amount of concurrent tests to run - defaults to 8
  • progressBar Option to display a progress bar - defaults to true
  • succinct Option to limit the amount of output on stdout/stderr - defaults to false
  • sort Sort function (to behave like a [].sort compareFunction), in case you need to customise the order in which the discovered tests are run.

npm Maintainers

0.2.1

9 years ago

0.2.0

9 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago