hath-assert

A set of hath assertions


Keywords
hath, assert, assertions
License
ISC
Install
npm install hath-assert@0.2.0

Documentation

hath-asserts

Build Status

A set of assertion helpers for hath. PRs welcome.

API

  • require('hath-assert')([<Hath>])
  • t.assertEquals(<any>, <any>, [<message>])
  • t.assertNotEquals(<any>, <any>, [<message>])
  • t.assertMatches(<RegExp>, <any>, [<message>])
  • t.assertNotMatches(<RegExp>, <any>, [<message>])
  • t.assertTruthy(<any>, [<message>])
  • t.assertFalsey(<any>, [<message>])
  • t.assertError(<any>, [<message>])
  • t.assertThrows(<function>, [<RegExp>])

Example

const Hath = require('hath-assert')()

function testFoo(t, done) {
    t.assertEquals(1, 1)
    done()
}

module.exports = Hath.suite('Hath Assert Example', [
    testFoo
]);

if (module === require.main) {
  module.exports(new Hath());
}