1.1.1 • Published 3 years ago

collapsed-assert v1.1.1

Weekly downloads
72
License
-
Repository
github
Last release
3 years ago

collapsed-assert

collapse TAP assert statements into a single line

Example

var CollapsedAssert = require("collapsed-assert");

/*  Use this when you want to do unit test assertions on
    large arrays or assertions for EVERY test before/after.

    This will stop `tape` printing one hundred lines of
    `ok N should be equal` and allows you to collapse that into
    a single line.

    If any of the assertions fails it will pass through all
    success & failures raw to the underlying `t`, but if they
    all succeed it's collapsed into a single

    `ok N should be ok`
*/
var cassert = new CollapsedAssert()
for (const item of items) {
  cassert.equal(item.foo, 'foo')
}
cassert.report(t, 'all items are good')

// TODO. State what the module does.

Installation

npm install collapsed-assert

Tests

npm test

Contributors

  • Raynos

MIT Licensed

1.1.1

3 years ago

1.1.0

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago