Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else {
await reportTestFinished(totalSuccess, totalFailed);
}
};
if (browsers.stable.length) {
const allBatchesExitCodes = await runTestInBatchesWithBrowsers_(
'stable',
browsers.stable,
config,
partialTestRunCompleteFn
);
if (allBatchesExitCodes || errored) {
await reportResults();
log(
yellow('Some tests have failed on'),
cyan('stable'),
yellow('browsers, so skipping running them on'),
cyan('beta'),
yellow('browsers.')
);
return allBatchesExitCodes || Number(errored);
}
}
if (browsers.beta.length) {
const allBatchesExitCodes = await runTestInBatchesWithBrowsers_(
'beta',
browsers.beta,
config,
partialTestRunCompleteFn
);
function uploadOutput_(functionName, outputFileName, outputDirs) {
const fileLogPrefix = colors.bold(colors.yellow(`${functionName}:`));
console.log(
`\n${fileLogPrefix} Compressing ` +
colors.cyan(outputDirs.split(' ').join(', ')) +
' into ' +
colors.cyan(outputFileName) +
'...'
);
exec('echo travis_fold:start:zip_results && echo');
execOrDie(`zip -r ${outputFileName} ${outputDirs}`);
exec('echo travis_fold:end:zip_results');
console.log(
`${fileLogPrefix} Uploading ` +
colors.cyan(outputFileName) +
' to ' +
function isYarnLockFileProperlyUpdated(fileName = 'yarn-checks.js') {
const localChanges = gitDiffColor();
const fileLogPrefix = colors.bold(colors.yellow(`${fileName}:`));
if (localChanges.includes('yarn.lock')) {
console.error(
fileLogPrefix,
colors.red('ERROR:'),
'This PR did not properly update',
colors.cyan('yarn.lock') + '.'
);
console.error(
fileLogPrefix,
colors.yellow('NOTE:'),
'To fix this, sync your branch to',
colors.cyan('upstream/master') + ', run',
colors.cyan('gulp update-packages') +
', and push a new commit containing the changes.'
);
console.error(fileLogPrefix, 'Expected changes:');
console.log(localChanges);
return false;
}
return true;
}
const execDemoCmd = (args,opts) => {
if(fs.existsSync(`${config.demoDir}/node_modules`)){
return execCmd('ng', args, opts, `/${config.demoDir}`);
}
else{
fancyLog(acolors.yellow(`No 'node_modules' found in '${config.demoDir}'. Installing dependencies for you...`));
return helpers.installDependencies({ cwd: `${config.demoDir}` })
.then(exitCode => exitCode === 0 ? execCmd('ng', args, opts, `/${config.demoDir}`) : Promise.reject())
.catch(e => {
fancyLog(acolors.red(`ng command failed. See below for errors.\n`));
fancyLog(acolors.red(e));
process.exit(1);
});
}
};
.finally(async () => {
log('verbose', 'Finished test', colors.yellow(name));
page.removeListener('console', consoleLogger);
availablePages.push(page);
});
pagePromises.push(pagePromise);
}
}
await Promise.all(pagePromises);
log('travis', '\n');
if (isTravisBuild() && testErrors.length > 0) {
testErrors.sort((a, b) => a.name.localeCompare(b.name));
log(
'info',
colors.yellow('Tests warnings and errors:'),
'expand this section'
);
console./*OK*/ log('travis_fold:start:visual_tests\n');
testErrors.forEach(logTestError);
console./*OK*/ log('travis_fold:end:visual_tests');
return false;
}
return true;
}
const isOK = condition => {
if (condition === undefined) {
return acolors.yellow('[SKIPPED]');
}
return condition ? acolors.green('[OK]') : acolors.red('[KO]');
};
gulp.task('kickstart', (cb) => {
log(
colors.yellow('Warning:'),
'the',
colors.cyan('kickstart'),
'task will potentially overwrite files in your src directory'
);
KickstartPrompt.prompt(
{
themeConfig: lfrThemeConfig.getConfig(),
},
(answers) => {
let tempNodeModulesPath;
let themeSrcPath;
if (answers.modulePath) {
themeSrcPath = answers.modulePath;
} else if (answers.module) {
function usesFilesOrLocalChanges(taskName) {
const validUsage = argv.files || argv.local_changes;
if (!validUsage) {
log(
yellow('NOTE 1:'),
'It is infeasible for',
cyan(`gulp ${taskName}`),
'to check all files in the repo at once.'
);
log(
yellow('NOTE 2:'),
'Please run',
cyan(`gulp ${taskName}`),
'with',
cyan('--files'),
'or',
cyan('--local_changes') + '.'
);
}
return validUsage;
}
eslint.results(function(results) {
if (results.errorCount == 0 && results.warningCount == 0) {
if (!isTravisBuild()) {
logOnSameLine(
colors.green('SUCCESS: ') + 'No linter warnings or errors.'
);
}
} else {
const prefix =
results.errorCount == 0
? colors.yellow('WARNING: ')
: colors.red('ERROR: ');
logOnSameLine(
prefix +
'Found ' +
results.errorCount +
' error(s) and ' +
results.warningCount +
' warning(s).'
);
if (!options.fix) {
log(
colors.yellow('NOTE 1:'),
'You may be able to automatically fix some of these warnings ' +
'/ errors by running',
colors.cyan('gulp lint --local_changes --fix'),
'from your local branch.'
const color = t => t >= 7 ? green(t) : t > 3 ? yellow(t) : red(t);
let time = 5;