@hydre/doubt

7.3.1 • Public • Published

@hydre/doubt

An elegant and minimal TAP 13 compliant testing library

Tester c'est douter

Test your code and pipe the output to a consumer like tape-spec-emoji

Concept

No fugazzi here, just equality

Toc

Install

npm i -D @hydre/doubt

Use

Usage is trivial

  • stdout - Doubt doesn't pollute the standard output, use any stream
  • title - Test suite title
  • calls - Enforce how many tests you want, it will fails if the count doesn't match
import Doubt from '@hydre/doubt'

const doubt = Doubt({
  stdout : process.stdout,
  title  : 'Testing is simple',
  calls  : 1,
})

And then write some tests

doubt['Roses are red']({
  because: 'red',
  is     : 'red',
})

Format

import Doubt from '@hydre/doubt'
import reporter from 'tap-spec-emoji'
import { pipeline, PassThrough } from 'stream'

const through = new PassThrough()

pipeline(
    through,
    reporter(),
    process.stdout,
    () => {},
)

const doubt = Doubt({
  stdout : through,
  title  : 'Testing is simple',
  calls  : 4,
})

doubt['Roses are red']({
  because: 'red',
  is     : 'red',
})

doubt['Violets are blue']({
  because: 'blue',
  is     : 'blue',
})

doubt['Doubt is awesome']({
  because: { amazing: true },
  is     : { amazing: true },
})

doubt['Your tests should be too']({
  because: { 'using doubt': true },
  is     : { 'using doubt': false },
})

Package Sidebar

Install

npm i @hydre/doubt

Homepage

hydre.io

Weekly Downloads

2

Version

7.3.1

License

MIT

Unpacked Size

10.1 kB

Total Files

8

Last publish

Collaborators

  • sceat
  • hydre-bot
  • deltaevo