<commit_before><a href="https://github.com/spumko"><img src="https://raw.github.com/spumko/spumko/master/images/from.png" align="right" /></a>
![lab Logo](https://raw.github.com/spumko/lab/master/images/lab.png)

Node test utility

[![Build Status](https://secure.travis-ci.org/spumko/lab.png)](http://travis-ci.org/spumko/lab)


## Introduction

**lab** is a simple test utility for node. Unlike other test utilities, lab uses domains instead of uncaught exception and other
global manipulation which created conflicts with some [**spumko**](https://github.com/spumko) modules. Our goal with **lab** is to
keep the execution engine as simple as possible, and not try to build an extensible framework.

## Command Line

**lab** supports the following command line options:
- `-c` - enables code coverage analysis.
- `-d` - dry run. Skips all tests. Use with `-v` to generate a test catalog. Defaults to `false`.
- `-e` - value to set the `NODE_ENV` environment variable to, defaults to 'test'.
- `-G` - export `Lab` as a global. Defaults to disabled. If you enable this, make sure to remove any `require('lab')` lines from your tests.
- `-i` - only run the test for the given identifier.
- `-l` - disables global variable leak detection.
- `-m` - individual tests timeout in milliseconds, defaults to 2 seconds.
- `-o` - file to write the report to, otherwise sent to stdout.
- `-p` - sets parallel execution as default test option. Defaults to serial execution.
- `-r` - the reporter used to generate the test results. Defaults to `console`. Options are:
    - `console` - text report.
    - `html` - HTML code coverage report (sets `-c`).
    - `json` - output results in JSON format.
    - `tap` - TAP protocol report.
- `-s` - silence test output, defaults to false.
- `-t` - minimum code test coverage percentage (sets `-c`), defaults to 100%.
- `-v` - verbose test output, defaults to false.

## Usage

To install **lab**:

```bash
$ npm install lab
```

To start:
```bash
$ lab
```

By default, **lab** loads all the '*.js' files inside the local 'test' directory and executes the tests found. To start **lab** using
different directories or files, pass those as arguments:
```bash
$ lab unit.js<commit_msg>Update README.md to reflect global access<commit_after><a href="https://github.com/spumko"><img src="https://raw.github.com/spumko/spumko/master/images/from.png" align="right" /></a>
![lab Logo](https://raw.github.com/spumko/lab/master/images/lab.png)

Node test utility

[![Build Status](https://secure.travis-ci.org/spumko/lab.png)](http://travis-ci.org/spumko/lab)


## Introduction

**lab** is a simple test utility for node. Unlike other test utilities, lab uses domains instead of uncaught exception and other
global manipulation which created conflicts with some [**spumko**](https://github.com/spumko) modules. Our goal with **lab** is to
keep the execution engine as simple as possible, and not try to build an extensible framework.

## Command Line

**lab** supports the following command line options:
- `-c` - enables code coverage analysis.
- `-d` - dry run. Skips all tests. Use with `-v` to generate a test catalog. Defaults to `false`.
- `-e` - value to set the `NODE_ENV` environment variable to, defaults to 'test'.
- `-G` - export `Lab` as a global. Defaults to disabled. If you enable this, make sure to remove any `require('lab')` lines from your tests.
- `-i` - only run the test for the given identifier.
- `-l` - disables global variable leak detection.
- `-m` - individual tests timeout in milliseconds, defaults to 2 seconds.
- `-o` - file to write the report to, otherwise sent to stdout.
- `-p` - sets parallel execution as default test option. Defaults to serial execution.
- `-r` - the reporter used to generate the test results. Defaults to `console`. Options are:
    - `console` - text report.
    - `html` - HTML code coverage report (sets `-c`).
    - `json` - output results in JSON format.
    - `tap` - TAP protocol report.
- `-s` - silence test output, defaults to false.
- `-t` - minimum code test coverage percentage (sets `-c`), defaults to 100%.
- `-v` - verbose test output, defaults to false.

## Usage

To install **lab** globally:

```bash
$ npm install -g lab
```

To use locally:
```bash
$ npm install --save-dev lab
```

Then in further examples you will have to call lab like so:
``` bash
$ ./node_modules/.bin/lab
```


To start:
```bash
$ lab
```

By default, **lab** loads all the '*.js' files inside the local 'test' directory and executes the tests found. To start **lab** using
different directories or files, pass those as arguments:
```bash
$ lab unit.js
{'fraction_non_alphanumeric': 0.13529284633671926, 'fraction_numerical': 0.0017289820618111088, 'mean_word_length': 3.628, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1803940', 'n_tokens_mistral': 1432, 'n_tokens_neox': 1372, 'n_words': 594}