Git Product home page Git Product logo

tap-arc's Introduction

tap-arc

A small (~12kB) TAP reporter with spec-like output, streaming, and failure diffing.

Objectives

  • minimal, informative spec-like output for all assertions
  • minimal, maintained dependencies -- can't be shipping React to CI
  • streaming in and out
  • helpful diffing for failures

tap-arc output screen shot

Installation & Usage

Compatible with Node.js 12+.

For a JavaScript project, save tap-arc as a development dependency:

npm i -D tap-arc

Simply pipe tap output to tap-arc.
Example npm test script:

// package.json
"scripts": {
  "test": "tape test/**/*.js | tap-arc"
}

💁 tap-arc will format output from any tap reporter. tape was used for testing.

Alternatively, use tap-arc globally:

npm i -g tap-arc

tap-arc --help

Usage:
  tap-arc <options>

Parses TAP data from stdin, and outputs a "spec-like" formatted result.

Options:

  -v | --verbose
    Output full stack trace

  -p | --pessimistic | --bail
    Immediately exit upon encountering a failure
    example: tap-arc -p

  --no-color
    Output without ANSI escape sequences for colors
    example: tap-arc --no-color

  --padding [space, dot, <custom characters>]
    String to use when padding output (default="  ")
    example: tap-arc --padding "••"
    example: tap-arc --padding dot

  --indent [space, dot, <custom characters>]
    String to use when indenting Object diffs (default="··")
    example: tap-arc --indent ">>"
    example: tap-arc --indent space

Development

The entirety of the reporter lives in ./index.js.

When building tap-arc, it's helpful to try various TAP outputs. See package.json "scripts" for useful "tap-arc:*" commands to test passing and failing TAP.

npm run tap-arc:simple # used to create the screen shot above

The main library is snapshot tested (npm test loads all snapshots to compare to current output). Create snapshots with the npm run make-snapshots commands.

Credit & Inspiration

  • tap-spec ol' reliable, but a bit stale and npm vulnerabilities
  • tap-difflet inspired output and diffing, also vulnerable
  • tap-min helpful approaches to streaming and exit codes

tap-arc's People

Contributors

tbeseda avatar ryanblock avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.