Nighttime Peanut Migrations

    collapsed-assert

    1.1.1 • Public • Published

    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

    Keywords

    none

    Install

    npm i collapsed-assert

    DownloadsWeekly Downloads

    83

    Version

    1.1.1

    License

    none

    Unpacked Size

    14.1 kB

    Total Files

    7

    Last publish

    Collaborators

    • raynos