UNPKG

tia

Version:

Time is All (logs driven test engine with ExtJs support)

70 lines 1.62 kB
"use strict"; /* globals gIn: true */ Object.defineProperty(exports, "__esModule", { value: true }); const ok = 'OK: '; // const okLn = `${ok}\n`; const FAIL = 'FAIL: '; // const failLn = `${FAIL}\n`; /** * Logs the specified msg. */ function print(msg) { gIn.logger.log(msg); } exports.print = print; /** * Logs the msg and EOL. */ function println(msg) { gIn.logger.logln(msg); } exports.println = println; /** * Logs separator. */ function sep() { gIn.logger.logln('=========='); } exports.sep = sep; /** * Logs End of Line. */ function eol() { gIn.logger.log('\n'); } exports.eol = eol; /** * Logs fail with optional msg. * Increases fails count. * @param [msg] - message to print. */ function fail(msg) { if (typeof msg !== 'undefined') { gIn.logger.fail(`${FAIL + msg}\n`); } gIn.tInfo.addFail(); } exports.fail = fail; /** * Logs Pass with optional msg. * Increases passes count. * @param msg - msg to log. * @param {Object} [mode] the mode * @param {Boolean} [mode.passSilently] - do not show message. * @param {Boolean} [mode.noPassIncrement] - do not increment pass counter. */ function pass(msg, mode = { passSilently: false, noPassIncrement: false }) { if (typeof msg !== 'undefined' && !mode.passSilently) { if (gIn.tInfo.getPassPrintingEnabled()) { gIn.logger.pass(`${ok + msg}\n`); } else if (gT.cLParams.forceLogActions) { gIn.cLogger.passIfEnabled(msg); } } if (!mode.noPassIncrement) { gIn.tInfo.addPass(); } } exports.pass = pass; //# sourceMappingURL=log.js.map