# testeq

> Stupid simple testing library

Latest version **0.1.2** (published 2018-08-30) · WTFPL license · 0 weekly downloads

## Install

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

Provides the command `testeq`.

## 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.1.2 |
| Published | 2018-08-30 |
| First published | 2018-08-22 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Phil A Thompson |
| Maintainers | philt |
| Keywords | Testing, tap, tape, TDD |

## Links

- npm: https://www.npmjs.com/package/testeq
- Repository: https://github.com/PhilT/testeq
- Homepage: https://github.com/PhilT/testeq#readme
- Issues: https://github.com/PhilT/testeq/issues
- npm.io page: https://npm.io/package/testeq

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

- 0.1.2 (latest) — 2018-08-30
- 0.0.1-security — 2018-08-22

## README

## testeq [![Build Status](https://travis-ci.org/PhilT/testeq.svg?branch=master)](https://travis-ci.org/PhilT/testeq)

A stupid simple test library.

* Basic assertions: `assert`, `equal`, `deepEqual`
* Only supports ES6 modules in `tests/` folder
* Outputs TAP compliant test results
* Tries to encourage Functional Programming
* Avoids exception based testing
* A splash of colour for the red/green brigade
* No dependencies
* Should work with any of the reporters from (https://github.com/substack/tape)
  Just be sure to add `--no-color`
* Follows Standard JS style guide

## Caveats

* It cheats a bit by using JSON.stringify to easily do deep comparisons
* Output is sent to STDOUT once all tests have run
  but I intend to scale this as needed
* I'm still learning FP and realise that some parts are far from it right now

## Motivation

* Limited API to force better testing practices
* Only support ES6 modules to keep it minimal
* It's designed not to run with module bundlers
  I find it (now) an unnecessary step in the test phase

## TODO

* Handle async
* Other stuff as needed
* Stream output rather than waiting until the end (Observable?)
* May support TAP version 13 at some point

## Usage

Run all .mjs module files under `tests/` folder:

    bin/testeq [--no-color]

Specify `--no-color` if you get garbled output or want to plug it into a TAP parser.

#### all_sorts_test.mjs

    import { assert, equal } from '../index.mjs'

    export default () => {
      return {
        'the truth is out there': () => {
          return assert(true)
        },

        'all things being equal': () => {
          return equal('matches', 'matches')
        }
      }
    }

#### outputs

    1..2
    ok 1 the truth is out there
    ok 2 all things being equal

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