Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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

About

collapse TAP assert statements into a single line

Resources

License

Packages

No packages published
You can’t perform that action at this time.