# asserts

> Test grouping and formatting to make working with vanilla node assert marginally easier

Latest version **4.0.2** (published 2014-07-06) · MIT license · 0 weekly downloads

## Install

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

## 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.0.2 |
| Published | 2014-07-06 |
| First published | 2012-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.5 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Stephen Handley |
| Maintainers | stephenhandley |
| Keywords | test, assert |

## Links

- npm: https://www.npmjs.com/package/asserts
- Repository: https://github.com/stephenhandley/asserts
- Issues: http://github.com/stephenhandley/asserts/issues
- npm.io page: https://npm.io/package/asserts

## Dependencies (1)

- [type-of-is](https://npm.io/package/type-of-is.md) ~3.3.0

## 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
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 4.0.2 (latest) — 2014-07-06
- 4.0.1 — 2014-06-26
- 4.0.0 — 2013-05-01
- 3.1.1 — 2013-03-05
- 3.1.0 — 2013-03-05
- 3.0.0 — 2012-10-09
- 2.2.0 — 2012-09-29
- 2.1.0 — 2012-09-28
- 2.0.0 — 2012-09-27
- 1.0.1 — 2012-09-26
- 1.0.0 — 2012-09-26
- 0.4.2 — 2012-06-05
- 0.4.1 — 2012-05-07
- 0.4.0 — 2012-05-07
- 0.3.1 — 2012-05-07
- … 1 more at https://npm.io/package/asserts/versions

## README

# Description

Test grouping and formatting to make working with vanilla node assert marginally easier

# Latest Version

4.0.2

# Installation
```
npm install asserts --save
```

or in package.json

```json
{
  ...
  "dependencies": {
    "asserts": "4.0.2"
  }
}
```

# Usage
NOTE: Examples below work but are out of date in demonstrating current functionality (particularly async support, .dir, and .all.*) check [test/test.js](https://github.com/stephenhandley/asserts/blob/master/test/test.js) for better examples.

[examples/happy.js](https://github.com/stephenhandley/asserts/blob/master/examples/happy.js) looks like this:

```js
var Assert = require('assert');
var Asserts = require('asserts');

Asserts({
  foo : function() {
    Assert.equal("something", "something", "optional message");
    Assert.equal(2, 2);
  },
  barf : {
    ing : function () {
      Assert.equal(1, 1, "okay");
    },
    ed : function() {
      Assert.equal(2, 2, "yep");
    }
  }
});
```
and when run looks like this:

![](https://raw.github.com/stephenhandley/asserts/master/examples/happy_output.png)

[examples/sad.js](https://github.com/stephenhandley/asserts/blob/master/examples/sad.js) looks like this:

```js
var Assert = require('assert');
var Asserts = require('asserts');

Asserts({
  "foo": function() {
    Assert.equal("something", "something", "optional message");
    Assert.equal(2, 2);
  },
  "barf" : {
    "ing": function () {
      Assert.equal(1, 1, "okay");
    },
    "ed": function() {
      Assert.equal(2, 3, "yep");
    },
    "o": {
      "rama": function() {
        Assert.equal(2, 10, "MATH");
      },
      "hnooooo": function() {
        Assert.equal(1, 1);
      }
    }
  },
  "meh": function() {
    Assert.equal(1, 2, "oh nooooo");
  }
});
```

and when run looks like this:

![](https://raw.github.com/stephenhandley/asserts/master/examples/sad_output.png)

Check test/test.js for example of Asserts.dir and Asserts.['equal', 'notEqual', 'deepEqual', 'notDeepEqual', 'strictEqual', 'notStrictEqual']

#TODO

add better documentation for 4.0.0 stuff - async support, .all., .dir

#Build status
[![build status](https://secure.travis-ci.org/stephenhandley/asserts.png)](http://travis-ci.org/stephenhandley/asserts)

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