A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/zoubin/tap-summary below:

GitHub - zoubin/tap-summary: Summarize TAP

A reporter for TAP.

{
  "scripts": {
    "test": "tape test/*.js | tap-summary"
  }
}
  --no-ansi        Disable ANSI formatting
  --no-progress    Disable progress output during tests
var summarize = require('tap-summary')

var fs = require('fs')
fs.createReadStream('test.tap')
  .pipe(summarize({
    ansi: true,
    progress: true,
  }))
  .pipe(process.stdout)

Also, the default formatter could be replaced with custom ones.

var reporter = require('tap-summary').reporter()

var fs = require('fs')
fs.createReadStream('test.tap')
  .pipe(customize(reporter))
  .pipe(process.stdout)

The reporter is a Duplex, which consumes the TAP input and output nothing by default. However, it emits the following events during the process, so that customize could listen to them and add something into the output.

Details about the test and assertion object could be found here.

The stats object:

var stats = {
  // the total time (ms) it takes
  duration: duration,
  // the total number of assertions planned
  planned: res.plans.reduce(function (p, c) {
    return c.to - c.from + 1 + p;
  }, 0),
  // the actual total number of assertions found
  assertions: res.asserts.length,
  // the number of successful assertions
  pass: res.pass.length,
  // the number of failed assertions
  fail: res.fail.length,
  // the number of comments found
  comments: res.comments.length,
}

fails will be null unless stats.fail > 0:

{ 
  testName: [failedAssertion]
}

comments will be null unless stats.comments > 0:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4