Neoclassical Programming Multitude

    @redsift/tape-reel

    0.1.1 • Public • Published

    tape-reel

    Circle CI npm MIT

    Simple tape wrapper to better integrate server side JSDOM testing and CircleCI.

    Usage

    Where you typically use Tape e.g.

    var tape = require("tape");
    

    Simply

    var tape = require("@redsift/tape-reel")("<div id='test'></div>");
    

    The HTML sets the JSDOM for environment for each test invocation. This document is provided in the global scope for easy integration with browser JavaScript components and passed as the second parameter to the function under test.

    Features

    Compared to a naked Tape setup, this wrapper provides the following pre-configurations:

    1. Setup and teardown a fresh JSDOM for each test.
    2. When run on CircleCI, produce a JUnit.xml compatible output in $CIRCLE_TEST_REPORTS/junit/junit.xml.
    3. When not run on CircleCI, pretty print with tap-diff and dump the DOM for failing tests. You may manually get a string representation of the DOM using tape.dumpJSDOM(document).

    Options

    var tape = require("@redsift/tape-reel")(JSDOM-HTML, SUPRESS-DOM, REPORT-NAME);
    
    Parameter Purpose Default
    JSDOM-HTML May be null if no JSDOM environment is required null
    SUPRESS-DOM By default, a failing test will dump the state of the DOM false
    REPORT-NAME Names the test report when generating junit.xml files on CircleCI junit

    Known Issues

    Currently, REPORT-NAME does not produce multiple junit.xml files due to a bug in the imported tap-xunit module.

    Install

    npm i @redsift/tape-reel

    DownloadsWeekly Downloads

    18

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    7.84 kB

    Total Files

    7

    Last publish

    Collaborators

    • luminous_cal
    • notmentat
    • pierredupuis
    • hortega_rs
    • alim-scott
    • anneshackelford
    • jrivaxrs
    • mcolladoredsift
    • redsift_operations
    • raul.lorenzo.redsift
    • rahulpowar
    • randalpinto
    • njaremek
    • earada
    • jordanw7
    • jmiralles
    • nascimj
    • kitty_vandergijp
    • neilsaccardo
    • bmayolasredsift