# macchiato

> Mocha styled tape with sinon

Latest version **4.6.0** (published 2015-11-08) · MIT license · 0 weekly downloads

## Install

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

Provides the command `macchiato`.

## 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 | 4.6.0 |
| Published | 2015-11-08 |
| First published | 2014-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sam Newman |
| Maintainers | sonewman |
| Keywords | mocha, tape, sinon, testing |

## Links

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

## Dependencies (9)

- [sinon](https://npm.io/package/sinon.md) ^1.9.1
- [tapout](https://npm.io/package/tapout.md) ^2.0.0
- [certain](https://npm.io/package/certain.md) ^1.8.0
- [inherits](https://npm.io/package/inherits.md) ^2.0.1
- [commander](https://npm.io/package/commander.md) ^2.3.0
- [util-extend](https://npm.io/package/util-extend.md) ^1.0.1
- [core-util-is](https://npm.io/package/core-util-is.md) ^1.0.1
- [foreach-async](https://npm.io/package/foreach-async.md) ^1.1.0
- [readable-stream](https://npm.io/package/readable-stream.md) ^1.1.13

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

- 4.6.0 (latest) — 2015-11-08
- 4.5.0 — 2015-11-08
- 4.4.0 — 2015-11-07
- 4.3.0 — 2015-08-30
- 4.2.1 — 2015-07-03
- 4.2.0 — 2015-07-03
- 4.1.0 — 2015-06-07
- 4.0.0 — 2015-05-23
- 3.1.1 — 2015-05-23
- 3.1.0 — 2015-05-23
- 3.0.1 — 2015-04-30
- 3.0.0 — 2015-04-28
- 2.8.0 — 2015-04-06
- 2.7.0 — 2015-03-21
- 2.6.0 — 2015-03-09
- … 16 more at https://npm.io/package/macchiato/versions

## README

# Macchiato

Install:
```bash
$ npm install --save-dev macchiato
```
and globally:
```bash
$ npm install -g macchiato
```

A [Mocha](https://github.com/visionmedia/mocha) / [Jasmine](https://github.com/pivotal/jasmine)
themed testing framework, comes equiped with a built in assertion library ([Certain](https://github.com/sonewman/certain)).

Each of the test contexts have various assert methods added to them which call `certain` under
the hood for ease of use. In addition to this each of the test contexts are instanciated [sinon](http://github.com/cjohansen/Sinon.JS) sandbox's!

```javascript
var describe = require('macchiato')({[options]})

// or

var describe = require('macchiato')
```
Once you've written your tests you can run them like this:
```bash
$ macchiato [-options] test/*.js

# or

$ node test/my-file.js [-options]
```

## Usage
### A New Way To Write Tests!
```javascript
describe('my test')
.beforeEach(function () {
  // sinon is baked in to the test context
  // and passed into all `beforeEach` and
  // `afterEach` callbacks. All spys/stubs
  // are restored after each test.
  this.myStub = this.stub()
})
.it('should do amazing things', function (t) {
  // the test context can be accessed as the first
  // arguments to the test callback
  t.equals('tape assertions are also baked into the framework', true)
  t.end()
})
.it('should do another thing', function () {
  // the test context is also `this` in the test callback
  this.assert(true, 'this test is asserting something')
  this.done()
})
```

### Classic way to write tests
```javascript
describe('my test', function () {

  describe.beforeEach(function () {
    // sinon is baked in to the test context
    // and passed into all `beforeEach` and
    // `afterEach` callbacks. All spys/stubs
    // are restored after each test.
    this.myStub = this.stub()
  })

  describe.it('should do amazing things', function (t) {
    // the test context can be accessed as the first
    // arguments to the test callback
    t.equals('assertions are also baked into the framework', true)
    t.end()
  })

  describe('my subtest', function () {

    descibe.it('should do something interesting', function () {
      // the test context is also `this` in the test callback
      this.assert(true, 'this test is asserting something')
      this.done()
    })
  })
})
```

## Version 2.*
The original version of `macchiato` was build ontop of the testing framework [Tape](https://github.com/substack/tape).
This is undoubtable an awesome testing framework, the problem was that when changes were
needed to tweak the inner workings of `Macchiato` this was very difficult since all of the main
design decisions had been made inside of Tape. I don't think Tape had really been build to accomodate that kind of abuse!

In `v2` this dependency has been completely removed. Macchiato now has it's own test runner.
This has made it much easier to manage and very modular, which means that in the future when features are added (to analyse test methods execution etc.) this will be a lot easier and also creates a lot of possibilies.

**Macchiato used to only output TAP (Test Anywhere Protocol), this has now changed.**

Macchiato has it's own output which is a lot like the `-R spec` option this is the default console output.

To change this output you can specify it as an option:

Javascript:

```javascript
describe({ output: 'tap' })
```
Terminal:
```bash
$ macchiato -o tap test/*.js
```

More documentation coming soon...

# Licence
MIT

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