# @srijs/hedgehog

> Hedgehog will eat all your bugs.

Latest version **0.1.5** (published 2017-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @srijs/hedgehog
pnpm add @srijs/hedgehog
yarn add @srijs/hedgehog
bun add @srijs/hedgehog
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2017-09-25 |
| First published | 2017-05-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sam Rijs |
| Maintainers | srijs |

## Links

- npm: https://www.npmjs.com/package/@srijs/hedgehog
- npm.io page: https://npm.io/package/@srijs/hedgehog

## Recent versions

- 0.1.5 (latest) — 2017-09-25
- 0.1.4 — 2017-09-23
- 0.1.3 — 2017-05-11
- 0.1.2 — 2017-05-10
- 0.1.1 — 2017-05-09
- 0.1.0 — 2017-05-09

## README

# hedgehog

<img src="https://github.com/hedgehogqa/haskell-hedgehog/raw/master/img/hedgehog-logo.png" width="33%" align="right"/>

Hedgehog is a modern property-based testing library.

It helps you write tests that catch more bugs with less code, are easier to write and to maintain.

You can use Hedgehog together with [Mocha](https://mochajs.org/), [Jest](https://facebook.github.io/jest/), and many other testing frameworks.

[![CircleCI](https://img.shields.io/circleci/project/github/srijs/node-hedgehog.svg)](https://circleci.com/gh/srijs/node-hedgehog/tree/master)
[![npm (scoped)](https://img.shields.io/npm/v/@srijs/hedgehog.svg)](https://www.npmjs.com/package/@srijs/hedgehog)
[![Codecov](https://img.shields.io/codecov/c/github/srijs/node-hedgehog.svg)](https://codecov.io/gh/srijs/node-hedgehog)
[![Greenkeeper badge](https://badges.greenkeeper.io/srijs/node-hedgehog.svg)](https://greenkeeper.io/)

## Installation

Hedgehog is available via `npm`.

```
npm install @srijs/hedgehog
```

## Usage

Just use your favorite testing framework, and sprinkle in some `forAll` goodness:

```javascript
import {forAll, Gen, Range} from '@srijs/hedgehog';

describe('arrays', () => {

    it('does not matter when an array is reversed twice', () => forAll({

        // Generate an array of booleans, with a length between 0 and 100.
        array: Gen.boolean().array(Range.linear(0, 100))

    }, ({array}) => {

        // Shallow copy the array and reverse it twice.
        const reversed = array.slice().reverse().reverse();
        // Compare it to the original array.
        expect(reversed).toEqual(array);

    }));

});
```

## Todo

- [ ] Performance tuning
- [ ] Randomness tests (uniformity, etc)

## License

MIT

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