alsatian
Version:
TypeScript and JavaScript testing framework for beautiful and readable tests
26 lines • 759 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const warn_1 = require("./warn");
function getStack() {
return new Error().stack.split("\n").map(stackLine => {
const STACK_ITEMS = stackLine
.replace(/^\s*at (.+) \((.+):\d+:\d+\)$/, "$1 $2")
.split(" ");
return {
functionName: STACK_ITEMS[0],
filePath: STACK_ITEMS[1]
};
});
}
class Logger {
static log(value) {
warn_1.Warner.warn("The log function may cause tests to be slow and should only be used for debugging.");
Logger.LOGS.push({
value,
stack: getStack()
});
}
}
exports.Logger = Logger;
Logger.LOGS = [];
//# sourceMappingURL=log.js.map
;