1. supertap
Generate TAP output
supertap
Package: supertap
Created by: vadimdemedes
Last modified: Thu, 19 May 2022 01:50:45 GMT
Version: 3.0.1
License: MIT
Downloads: 1,040,831
Repository: https://github.com/vadimdemedes/supertap

Install

npm install supertap
yarn add supertap


SUPERTAP


Build Status

Generate TAP output

Install

$ npm install supertap

Usage

 import * as supertap from 'supertap';

console.log(supertap.start());

console.log(supertap.test('passing', {
	index: 1,
	passed: true
}));

console.log(supertap.finish({
	passed: 1
}));

Output:

TAP version 13
# passing
ok 1 - passing

1..1
# tests 1
# pass 1
# fail 0

API

start()

Always returns 'TAP version 13' string.

test(title, options)

title

Type: string

Test title.

options

index

Type: number

Index of the test. Should start with one, not zero.

passed

Type: boolean

Default: false

Status of the test.

error

Type: Error object

If test has failed (passed is false), error should be an instance of an actual error.
It can also be an object, which fields will be included in the output (e.g. name, message, actual, expected).

 supertest.test('failing', {
	index: 1,
	passed: false,
	error: new Error()
});
todo
skip

Type: boolean

Default: false

Mark test as to-do or as skipped.

comment

Type: string array

Comments for that test.

finish(stats)

stats

passed
failed
skipped
todo
crashed

Type: number

Default: 0

Number of tests that passed, failed, skipped or marked as todo. crashed is a special option, which adds to failed test count in the output, but not total test count. AVA uses it to count unhandled exceptions.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin