# build-test

> Testing command line tool.

Latest version **2.0.15** (published 2016-07-15) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install build-test
pnpm add build-test
yarn add build-test
bun add build-test
```

Provides the command `build-test`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.15 |
| Published | 2016-07-15 |
| First published | 2015-12-15 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | natewallace@gmail.com |
| Maintainers | natewallace |
| Keywords | test |

## Links

- npm: https://www.npmjs.com/package/build-test
- Repository: https://github.com/iservices/build-test
- Homepage: https://github.com/iservices/build-test#readme
- Issues: https://github.com/iservices/build-test/issues
- npm.io page: https://npm.io/package/build-test

## Dependencies (7)

- [mocha](https://npm.io/package/mocha.md) ^2.5.3
- [globby](https://npm.io/package/globby.md) ^5.0.0
- [chokidar](https://npm.io/package/chokidar.md) ^1.5.2
- [istanbul](https://npm.io/package/istanbul.md) ^0.4.3
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^4.0.0
- [mocha-junit-reporter](https://npm.io/package/mocha-junit-reporter.md) ^1.9.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 2.0.15 (latest) — 2016-07-15
- 2.0.14 — 2016-07-15
- 2.0.13 — 2016-07-15
- 2.0.12 — 2016-07-15
- 2.0.11 — 2016-07-15
- 2.0.10 — 2016-07-01
- 2.0.9 — 2016-07-01
- 2.0.8 — 2016-07-01
- 2.0.7 — 2016-06-30
- 2.0.6 — 2016-06-22
- 2.0.5 — 2016-06-17
- 2.0.4 — 2016-06-15
- 2.0.3 — 2016-06-15
- 2.0.2 — 2016-06-15
- 2.0.1 — 2016-06-14
- … 11 more at https://npm.io/package/build-test/versions

## README

# build-test

This package is currently in **BETA**

## Overview

This is a command line tool that performs testing and code coverage.
It uses [mocha](https://www.npmjs.com/package/mocha) to perform testing and [istanbul](https://www.npmjs.com/package/istanbul) to perform
code coverage.

## Guide

To start you will need to install this package for your project by executing the following command within your project from the console.

```
npm install --save-dev build-test
``` 
Once the package is installed you can run the tool from a terminal using the `build-test` command.  Normally you will
do this within an npm script element.  Take the following excerpt from an example package.json file:

```JSON
{
  "scripts": {
    "test": "build-test \"src/tests/*.spec.js\" -c \"src/**/*.js\" -c \"!src/tests/**/*.js\" ",
    "test-watch": "build-test \"src/tests/*.spec.js\" -c \"src/**/*.js\" -c \"!src/tests/**/*.js\" -w",
  }
}
```

In the example above the `test` script will run the tests found in files that end with a `.spec.js` extension within the `src/tests/` folder.
It will also provide code coverage metrics for files with an extension of `.js` within the `src/` but not the `src/tests/` folder.
The `test-watch` script will perform testing for the same `.spec.js` files whenever one of them is updated or added.

Also notice that the glob patterns are surrounded by double quotes.  This is necessary in order to prevent the terminal from expanding
the glob patterns into actual file paths.

## API

Usage:
```
build-test <files> [<files>] [-c <files>]  
           [-o <out directory>] [-w] [-f <format>] [-r <module>]  
           [--branches <number>] [--functions <number>] [--lines <number>] [--statements <number>]
```
Options:

| Option | Description |
| ---    | ---         |
| `<files>` | A glob pattern that identifies files that contain unit tests.  Multiple glob patterns can be specified. |
| -c     | A glob pattern that identifies files to produce code coverage metrics for. Multiple glob patterns can be specified. |
| -f     | The format for the output.  Options are: console, file. |
| -o     | The directory to send output to.  This defaults to testResults/. |
| -r     | A modue to require before any tests are run. |
| -w     | When present the files specified in the files glob pattern(s) will be watched for changes and tested when they do change. |
| --branches    | Global branch coverage threshold when code coverage is performed. |
| --functions   | Global function coverage threshold when code coverage is performed. |
| --lines       | Global line coverage threshold when code coverage is performed. |
| --statements  | Global statement coverage threshold when code coverage is performed. |

---
_Source: https://npm.io/package/build-test · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
