collapsed-assert
v1.1.1
Published
collapse TAP assert statements into a single line
Downloads
6
Readme
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