Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let envValues = `LOCALE=${locale} `;
let exitProcess = false;
process.on('SIGINT', () => {
exitProcess = true;
});
const form = factors[factor];
if (form) {
process.env.FORM_FACTOR = form;
envValues += `FORM_FACTOR=${form}`;
}
envValues = Logger.emphasis(envValues);
Logger.log(`Running tests for: ${envValues}`, { context });
// eslint-disable-next-line no-await-in-loop
await new Launcher(configPath, testSetup)
.run()
.then(
(code) => {
// If we receive a test failure, exit with a status of 1. exitProcess is a special case
// where the user hit Ctrl-C and will be handled in the else block.
if (code === 1 && !continueOnFail && !exitProcess) {
Logger.error(`Running tests for: ${envValues} failed.`, { context });
process.exit(1);
} else {
onReturnSuccess(exitProcess, envValues);
}
},
(error) => {
Logger.error(`Launcher failed to start the test ${error.stacktrace}`, { context });
process.exit(1);
},
const locale = locales[localeI];
process.env.LOCALE = locale;
for (let factor = 0; factor < factors.length; factor += 1) {
let envValues = `LOCALE=${locale} `;
const form = factors[factor];
if (form) {
process.env.FORM_FACTOR = form;
envValues += `FORM_FACTOR=${form}`;
}
envValues = Logger.emphasis(envValues);
Logger.log(`Running tests for: ${envValues}`, { context });
// eslint-disable-next-line no-await-in-loop
await new Launcher(configPath, testSetup)
.run()
.then(
(code) => {
if (code === 1 && !continueOnFail) {
Logger.error(`Running tests for: ${envValues} failed.`, { context });
process.exit(1);
} else {
Logger.log(`Finished tests for: ${envValues}\n\n---------------------------------------\n`, { context });
}
},
(error) => {
Logger.error(`Launcher failed to start the test ${error.stacktrace}`, { context });
process.exit(1);
},
);
}
function runWDIO() {
var config = parseCmdline(process.argv);
reportStream = fs.createWriteStream(config.reportFile);
var configFile = config.wdioConfig;
var opts = {
reporters: [TaurusReporter],
};
var wdio = new Launcher(configFile, opts);
function done(code) {
if (reportStream) {
reportStream.end();
}
process.exit(code);
}
function handleError(error) {
console.error("Launcher failed to start the test", error);
done(1);
}
var startTime = epoch();
function loopWDIO(code) {