Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// nightwatch marks it as failed
test.status = Test.TEST_STATUS_SKIPPED;
return;
}
let status = clc.greenBright("PASS");
let enqueueNote = "";
/* eslint-disable indent */
switch (test.status) {
case Test.TEST_STATUS_SUCCESSFUL:
// Add this test to the passed test list, then remove it from the failed test
// list (just in case it's a test we just retried after a previous failure).
break;
case Test.TEST_STATUS_FAILED:
status = clc.redBright("FAIL");
if (this.settings.gatherTrends) {
const key = test.toString();
/*eslint-disable no-magic-numbers*/
this.trends.failures[key] = this.trends.failures[key] > -1
? this.trends.failures[key] + 1 : 1;
}
// if suite should bail due to failure
this.strategies.bail.shouldBail({
totalTests: this.queue.tests,
passedTests: this.queue.getPassedTests(),
failedTests: this.queue.getFailedTests()
});
// Note: Tests that failed but can still run again are pushed back into the queue.
_findFile(pathname) {
if (!existsSync(pathname)) {
console.log(clc.redBright("\nError!!!\n"));
console.error(clc.whiteBright("File does not exist."));
process.exit(1);
} else {
//If is not a HTML file
if (!/\w*.html$/.test(pathname)) {
console.log(clc.redBright("\nError!!!\n"));
console.error(clc.whiteBright("Please select a html file."));
process.exit(1);
} else {
const data = readFileAsString(pathname);
//Remove external files routes
this._file = data
.replace(/#(js|css) .*(\n|\r\n|\r)/g, "")
.split(//g)
.map((e, i) => i > 0 ? e.replace(/(\n|\r|\r\n)*(.*(\n|\r|\r\n)*)*<\/script>/, "") : e)
function showErrors() {
const errorKeys = Object.keys(global.Errors);
const warningKeys = Object.keys(global.Warnings);
if (errorKeys.length > 0) {
console.log(clc.redBright("\nError!!!"));
errorKeys.forEach(key => {
console.log(clc.whiteBright(`\n${key}:\n`));
global.Errors[key].forEach(line => {
console.log(line);
});
});
process.exit(1);
}
if (warningKeys.length > 0) {
console.log(clc.yellowBright("\nWarning!!!"));
warningKeys.forEach(key => {
console.log(clc.whiteBright(`\n${key}:\n`));
global.Errors[key].forEach(line => {
console.log(line);
});
});
}, function (optout) {
common.config.set("optout", optout === "no", f.wait());
if (optout) {
logger.log("Opting-out of sending usage and crash reports.");
} else {
//logger.log(clc.yellowBright("Thanks"), "for helping out by sending usage and crash reports!");
}
logger.log("Please " + clc.greenBright("register") + " your product by providing us with your name and email address. Leave these " + clc.redBright("blank") + " to opt-out:");
ask("Name: ", f.slotPlain());
}, function (name_resp) {
name = name_resp.toString().trim();
+ color.yellowBright(' (' + data.details + ')'));
}
});
var lastLine = data[n - 1];
if (lastLine) {
var indent = new Array(n).join(' ');
var msgLines = msg.join('\n').split('\n');
var msgText = msgLines.join('\n ' + indent);
out.push(indent + '└ '
+ color.redBright(
msgText
+ (msgLines.length > 1 ? '\n' + indent : '')
+ color.white(' at ')
+ color.green(lastLine.file) + ':' + color.blueBright(lastLine.line)
+ ' ' + color.redBright(lastLine.func)
+ color.yellowBright(' (' + lastLine.details + ')')
));
}
} catch (e) {
out.push(e.stack);
out.push(error.stack);
}
return out.join('\n');
}
.then(json => {
if (json.userNameAvailable === true) {
console.log(clc.greenBright("\n Username is available to take on " +clc.cyanBright(appName)));
console.log(" "+site.url)
}
else if(json.userNameAvailable === false) {
console.log(clc.redBright("\n Username already taken on " +clc.cyanBright(appName)));
console.log(" "+site.url)
}
else{
console.log(clc.redBright(json.errorMessage))
}
})
} catch (err) {
], function (err) {
if(err){
console.log(err)
console.log(clc.blackBright('waterfall for'),clc.yellowBright('maintenance.entities'), clc.redBright('failed'))
} else {
console.log(clc.blackBright('waterfall for'),clc.yellowBright('maintenance.entities'), clc.cyanBright('completed'))
}
});
return
.then(json => {
console.log("\n Checking : "+json.appName)
if (json.userNameAvailable === true) {
counter++;
console.log(clc.greenBright(` Username is available to take on ${clc.cyanBright(site.name)}`));
console.log(" "+site.url+ "\n")
}
else if(json.userNameAvailable === false) {
console.log(clc.redBright(` Username already taken on ${clc.cyanBright(site.name)}`));
console.log(" "+site.url+ "\n")
}
})
} catch (err) {
function logCommand(cmd) {
console.log(clc.blueBright("> " + cmd.cmd.map(function (piece) { return JSON.stringify(piece); }).join(" ")));
var stdout = cmd.stdout.replace(/(^\s+|\s+$)/g, '').replace(/\n/g, clc.greenBright("\n || "));
var stderr = cmd.stderr.replace(/(^\s+|\s+$)/g, '').replace(/\n/g, clc.redBright("\n || "));
stdout && console.log(clc.greenBright(" || ") + stdout);
stderr && console.log(clc.redBright(" || ") + stderr);
console.log(!cmd.code ? "(exit code 0)" : clc.redBright("(exit code " + cmd.code + ")"));
}
attrs.forEach(function (attr) {
tagStr = tagStr.replace(attr, cliColor.redBright(attr));
});
}