@jpweeks/tap-browser-el

2.0.1 • Public • Published

tap-browser-el

experimental

tap-brower-el default stypes

A tap/tape reporter which adds a dom element to the dom

Usage

NPM

tap-browser-el will override console.log and watch what's being pushed to it and parse any tap/tape content.

Example:

require('tap-browser-el')( {
    // you can optionally pass in el
    // by default a <div> will be created on body
    el: someDomElementWhichTapContentWillBeWrittenTo,

    // if you want tap output to console pass in true
    // if you don't then pass in false
    outPutToConsole: true,

    // you can pass in styles to override default styles
    // if css is not passed default styles will be applied
    // 
    // to apply no inline styles pass `false`
    css: {

        // pass in selector to apply css to parts
        // may seem redundant but it makes this module
        // more 
        '.tap-test.pass': {
            background: '#0F0'
        },

        '.tap-test.fail': {
            background: '#F00'
        }
    },

    // this is a callback you can pass for when one test is finished one part
    // of the test
    onFinishedTestPart: function() {}.

    // this is a callback you can pass for when one test is finished
    onFinishedTest: function() {},

    // this is a callback you can pass for when everything is finished
    onFinished: function() {}
});

If you want to see more examples check the test folder.

License

MIT, see LICENSE.md for details.

Dependencies (1)

Dev Dependencies (1)

Package Sidebar

Install

npm i @jpweeks/tap-browser-el

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

57.9 kB

Total Files

10

Last publish

Collaborators

  • jpweeks