Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tap-mocha-reporter

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tap-mocha-reporter - npm Package Compare versions

Comparing version 0.0.23 to 0.0.24

out.html

48

lib/reporters/markdown.js

@@ -36,3 +36,3 @@ /**

function title(str) {
return Array(level).join('#') + ' ' + str;
return Array(level + 1).join('#') + ' ' + str;
}

@@ -70,3 +70,7 @@

function generateTOC(suite) {
function generateTOC() {
return suites.map(generateTOC_).join('')
}
function generateTOC_(suite) {
var obj = mapTOC(suite, {});

@@ -76,5 +80,9 @@ return stringifyTOC(obj, 0);

generateTOC(runner.suite);
var suites = []
var currentSuite = null
runner.on('suite', function(suite){
currentSuite = suite
if (suite.root) {
suites.push(suite)
}
++level;

@@ -87,11 +95,28 @@ var slug = utils.slug(suite.fullTitle());

runner.on('suite end', function(suite){
if (suite.ok) {
buf += '\nok - ' + suite.title + '\n'
} else {
buf += '\nnot ok - ' + suite.title + '\n'
}
--level;
});
runner.on('pass', function(test){
var code = utils.clean(test.fn.toString());
buf += test.title + '.\n';
buf += '\n```js\n';
buf += code + '\n';
buf += '```\n\n';
runner.on('test', function(test){
if (!test.ok || test.pending) {
var code = utils.clean(test.fn.toString());
buf += test.title + '.\n';
if (code) {
buf += '\n```js\n';
buf += code + '\n';
buf += '```\n';
}
var stack = test.err && test.err.stack
if (!stack) {
stack = test.result && test.result.diag && test.result.diag.stack
}
if (stack) {
buf += '\n```\n' + stack + '\n```\n';
}
buf += '\n\n';
}
});

@@ -101,5 +126,6 @@

process.stdout.write('# TOC\n');
process.stdout.write(generateTOC(runner.suite));
process.stdout.write(generateTOC());
process.stdout.write('\n\n');
process.stdout.write(buf);
});
}
{
"name": "tap-mocha-reporter",
"version": "0.0.23",
"version": "0.0.24",
"description": "Format a TAP stream using Mocha's set of reporters",

@@ -5,0 +5,0 @@ "main": "index.js",

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