# angelo

> A (rerunnable) Mocha test runner

Latest version **0.0.20** (published 2016-11-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install angelo
pnpm add angelo
yarn add angelo
bun add angelo
```

Provides the command `angelo`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.20 |
| Published | 2016-11-30 |
| First published | 2014-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 10 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Jason Huggins |
| Maintainers | hugs |
| Keywords | mocha, test, testing, automation, angelo, moriondo |

## Links

- npm: https://www.npmjs.com/package/angelo
- Repository: https://github.com/hugs/angelo
- Issues: https://github.com/hugs/angelo/issues
- npm.io page: https://npm.io/package/angelo

## Dependencies (10)

- [uuid](https://npm.io/package/uuid.md) *
- [mocha](https://npm.io/package/mocha.md) *
- [sleep](https://npm.io/package/sleep.md) *
- [cabbie](https://npm.io/package/cabbie.md) *
- [actorify](https://npm.io/package/actorify.md) *
- [minimist](https://npm.io/package/minimist.md) *
- [stack-trace](https://npm.io/package/stack-trace.md) *
- [chromedriver](https://npm.io/package/chromedriver.md) *
- [better-assert](https://npm.io/package/better-assert.md) *
- [coffee-script](https://npm.io/package/coffee-script.md) *

## 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

- 0.0.20 (latest) — 2016-11-30
- 0.0.15 — 2014-07-15
- 0.0.14 — 2014-07-15
- 0.0.13 — 2014-07-09
- 0.0.12 — 2014-07-09
- 0.0.11 — 2014-07-08
- 0.0.10 — 2014-07-08
- 0.0.9 — 2014-07-08
- 0.0.8 — 2014-07-08
- 0.0.7 — 2014-07-08
- 0.0.6 — 2014-07-06
- 0.0.5 — 2014-07-06
- 0.0.4 — 2014-07-06
- 0.0.3 — 2014-07-06
- 0.0.2 — 2014-07-06
- … 1 more at https://npm.io/package/angelo/versions

## README

## Angelo - A (rerunnable) Mocha test runner

- Useful for running (and rerunning!) Mocha test suites.

- Simple API. Load and play -- that's all you need to know!


### Install

    npm install angelo

### Example usage
 
    Angelo = require('angelo').Angelo
    angelo = new Angelo()
    angelo.load("/path/to/test.js")
    angelo.play()

### FAQ

#### Why "Angelo"?

[Angelo Moriondo](http://en.wikipedia.org/wiki/Angelo_Moriondo) is the inventor of the first espresso machine.

#### Okay, but why use this library?

You might like Angelo if:

  1) You [use mocha programmatically](https://github.com/visionmedia/mocha/wiki/Using-mocha-programmatically).

  **and**
  
  2) You want to [rerun a test suite multiple times](https://github.com/visionmedia/mocha/issues/736).

[TJ says it best](https://github.com/visionmedia/mocha/pull/977#issuecomment-24460957):

    "IMO this should be done with complete process isolation, you could use 
    json-stream or the json reporter and exec(), plus then that keeps mocha 
    lighter. win-win situation :D" - TJ 

And that's what Angelo does!

Mocha has an issue with re-running test suites within the same process. This is because Mocha uses a call to `require` to load test files. When `require` is called, however, files are cached and only loaded once. A side-effect of this reliance on `require` is that tests are only ever run once. 

As a workaround, you could [clear the cache](https://github.com/visionmedia/mocha/pull/266#issuecomment-11794765) of loaded modules before reloading, but this isn't foolproof. Instead, Angelo does what TJ recommends -- it runs Mocha in a child process and receives results via the JSON stream reporter.

Angelo uses `spawn`, instead of `exec`, so that results can be streamed as they happen. Using `exec` would buffer all results until all the tests were completed.

Lasly, another benefit of Angelo is the ability to run tests in parallel.  Now that test execution is running in a separate child process, you can run multiple test files in parallel by creating multiple Angelo objects.

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