mirror of
https://github.com/Netflix/dial-reference.git
synced 2026-06-08 10:59:59 +00:00
33 lines
851 B
JavaScript
33 lines
851 B
JavaScript
"use strict";
|
|
|
|
var colors = require("colors/safe");
|
|
var sprintf = require("sprintf-js").sprintf;
|
|
|
|
function getParam(key) {
|
|
var value;
|
|
var args = process.argv.slice(2);
|
|
args.forEach(function (param) {
|
|
if(param.indexOf(key + "=") === 0) {
|
|
value = param.split("=")[1];
|
|
}
|
|
});
|
|
return value;
|
|
}
|
|
|
|
function printTestInfo(test, msg) {
|
|
return console.log(sprintf("%-20s : %-s\n%-20s : %-s", "Test", test, "Description", msg));
|
|
}
|
|
|
|
function printSuccess() {
|
|
return console.log(colors.green("TEST PASSED\n"));
|
|
}
|
|
|
|
function printFailure(err) {
|
|
return console.log(colors.red(sprintf("%-20s : %-s\n", "TEST FAILED", err)));
|
|
}
|
|
|
|
module.exports.getParam = getParam;
|
|
module.exports.printTestInfo = printTestInfo;
|
|
module.exports.printSuccess = printSuccess;
|
|
module.exports.printFailure = printFailure;
|