api-supertest
Advanced tools
Comparing version 0.1.0 to 0.1.1
"use strict"; | ||
var colors = require("colors/safe"); | ||
var colors = process.env.NO_COLORS ? { | ||
gray: passText, | ||
bold: passText, | ||
red: passText, | ||
green: passText | ||
} : require("colors/safe"); | ||
function passText(text) { | ||
return text; | ||
} | ||
function processStack(error) { | ||
if (error.stack) { | ||
if (process.env.NO_STACK) { | ||
return error.message; | ||
} | ||
return error.stack.replace(/^(\s+at\s+.*)$/mig, function (match) { | ||
return colors.gray(match); | ||
}); | ||
} | ||
return error; | ||
} | ||
function indent(text, indent) { | ||
return indent + text.split("\n").join("\n" + indent); | ||
} | ||
function renderPrefix(item) { | ||
var result = colors.bold(item.path); | ||
if (item.data) { | ||
result += colors.gray(" (" + item.method + " " + item.data + ")"); | ||
} else if (item.method !== "GET") { | ||
result += colors.gray(" (" + item.method + ")") | ||
} | ||
return result + ": "; | ||
} | ||
function indent(text, indent) { | ||
return indent + text.split("\n").join("\n" + indent); | ||
@@ -41,7 +77,3 @@ } | ||
console.log(colors.red("ERROR")); | ||
if (error.stack) { | ||
error = error.stack.replace(/^(\s+at\s+.*)$/mig, function (match) { | ||
return colors.dim.gray(match); | ||
}); | ||
} | ||
error = processStack(error); | ||
console.log("\n" + indent(error, " ") + "\n"); | ||
@@ -48,0 +80,0 @@ } else { |
{ | ||
"name": "api-supertest", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Beautiful test suite & runner for api tests.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17973
430
5