New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bitwane-test

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitwane-test

The test formatting version of bitwane

  • 1.1.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bitwane-test

A test output version of bitwane.

Install

npm install bitwane-test

Usage

import { TestLogger } from '../';
const logger = new TestLogger();

//Print a diff of an object
logger.diff({
    one: 1,
    two: 2,
    thing: 'thing1',
    sub: {
        subone: 1,
        subtwo: 2
    }
}, {
    one: 1,
    three: 'three',
    thing: 'thing2',
    sub: {
        subone: 1
    }
});

//Print a diff a string.
logger.diff(`I am thing one`, `I am thing two`)
//Print a diff a string, and indent it.
logger.diff(`I am a thing one`, `I am thing two`, 4)

//Print an ok (log) line, and indent it 8 spaces.
logger.ok('This is ok', null, 8);
//Print a notok (error) line.
logger.notok('This is not ok');
//Print an formatted ok line with a red colored word.
logger.ok('The $(red)%(what)$() is red.', {what: 'moon'});

The constructor

The constructor takes the same options as bitwane with an extra option named maps.

const logger = new TestLogger({
    //These are all default values
    maps: {
        ok(value){
            return logSymbols.success + ' ' + value;
        },
        notok(value){
            return logSymbols.error + ' ' + value;
        },
        diff(lvalue, rvalue, indent){
            //Return a diff string
            //An inline diff is the default
        }
    }
});

About

bitwane-test inherits from bitwane. It is meant for formatting test output.

Keywords

FAQs

Package last updated on 10 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc