UNPKG

console-fail-test

Version:

Gently fails test runs if the console was used during them. 📢

16 lines • 701 B
import { formatComplaintCall } from "./formatComplaintCall.js"; const lineThreshold = 3; const formatMethodComplaint = ([methodName, calls]) => { const summary = ` * ${methodName} (${calls.length} call${calls.length === 1 ? "" : "s"})`; const lines = calls.slice(0, Math.min(calls.length, lineThreshold)).map(formatComplaintLineWithIndex); if (calls.length > lineThreshold) { lines.push(`...${calls.length - lineThreshold} more`); } return `${summary} ${lines.map((line) => ` > Call ${line}`).join("\n")}`; }; const formatComplaintLineWithIndex = (call, i) => `${i}: ${formatComplaintCall(call)}`; export { formatMethodComplaint }; //# sourceMappingURL=formatMethodComplaint.js.map