How to use supertap - 4 common examples

To help you get started, we’ve selected a few supertap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github avajs / ava / lib / reporters / tap.js View on Github external
writeCrash(evt, title) {
		this.crashCount++;
		this.reportStream.write(supertap.test(title || evt.err.summary || evt.type, {
			comment: evt.logs,
			error: evt.err ? dumpError(evt.err) : null,
			index: ++this.i,
			passed: false,
			skip: false,
			todo: false
		}) + os.EOL);
	}
github avajs / ava / lib / reporters / tap.js View on Github external
writeTest(evt, flags) {
		this.reportStream.write(supertap.test(this.prefixTitle(evt.testFile, evt.title), {
			comment: evt.logs,
			error: evt.err ? dumpError(evt.err) : null,
			index: ++this.i,
			passed: flags.passed,
			skip: flags.skip,
			todo: flags.todo
		}) + os.EOL);
	}
github avajs / ava / lib / reporters / tap.js View on Github external
endRun() {
		if (this.stats) {
			this.reportStream.write(supertap.finish({
				crashed: this.crashCount,
				failed: this.stats.failedTests + this.stats.remainingTests,
				passed: this.stats.passedTests + this.stats.passedKnownFailingTests,
				skipped: this.stats.skippedTests,
				todo: this.stats.todoTests
			}) + os.EOL);

			if (this.stats.parallelRuns) {
				const {currentFileCount, currentIndex, totalRuns} = this.stats.parallelRuns;
				this.reportStream.write(`# Ran ${currentFileCount} test ${plur('file', currentFileCount)} out of ${this.stats.files} for job ${currentIndex + 1} of ${totalRuns}` + os.EOL + os.EOL);
			}
		} else {
			this.reportStream.write(supertap.finish({
				crashed: this.crashCount,
				failed: 0,
				passed: 0,
				skipped: 0,
				todo: 0
			}) + os.EOL);
		}
	}
github avajs / ava / lib / reporters / tap.js View on Github external
startRun(plan) {
		if (plan.files.length > 1) {
			this.prefixTitle = (testFile, title) => prefixTitle(plan.filePathPrefix, testFile, title);
		}

		plan.status.on('stateChange', evt => this.consumeStateChange(evt));

		this.reportStream.write(supertap.start() + os.EOL);
	}

supertap

Generate TAP output

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis