Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const namePart = `${log.bold}${result.name}${log.reset}`;
const auditTitlePart = result.auditTitle || '';
const documentationPart = result.auditDocumentationLink
? `Documentation: ${result.auditDocumentationLink}`
: '';
const titleAndDocs = [auditTitlePart, documentationPart]
.filter(Boolean)
.map(s => ` ` + s)
.join('\n');
const humanFriendlyParts = titleAndDocs ? `\n${titleAndDocs}\n` : '';
process.stderr.write(`
${icon} ${idPart}${propertyPart} ${label} for ${namePart} assertion${humanFriendlyParts}
expected: ${result.operator}${log.greenify(result.expected)}
found: ${log.redify(result.actual)}
${log.dim}all values: ${result.values.join(', ')}${log.reset}\n\n`);
}
}
saveAssertionResults(allResults);
if (hasFailure) {
process.stderr.write(`Assertion failed. Exiting with status code 1.\n`);
process.exit(1);
}
process.stderr.write(`All results processed!\n`);
}
}).catch(err => {
lights.resetLights();
console.error(Log.redify(err));
});