if (process.stdout.isTTY && !process.env.CI) { await runEditor(editor, messageFile) } else if (process.env.CLINIC_MOCK_ASK_MESSAGE) {
before(async () => { const launchOptions = process.env.CI ? {} : { headless: false, slowMo: 5, }; // Workaround till https://github.com/GoogleChrome/puppeteer/issues/290 is fixed if (process.env.LAUNCH_CHROME_NO_SANDBOX) { console.warn('Launching Chrome with "--no-sandbox" option. ' + 'This is not recommended due to security reasons!'); Object.assign(launchOptions, { args: ['--no-sandbox'] }); } browser = await puppeteer.launch(launchOptions); page = await browser.newPage(); await page.setViewport({ width: 1024, height: 768, }); });
// Create the production build and print the deployment instructions. function build(previousFileSizes) { console.log('Creating an optimized production build...'); let compiler = webpack(config); return new Promise((resolve, reject) => { compiler.run((err, stats) => { if (err) { return reject(err); } const messages = formatWebpackMessages(stats.toJson({}, true)); if (messages.errors.length) { return reject(new Error(messages.errors.join('\n\n'))); } if (process.env.CI && messages.warnings.length) { console.log(); console.log( chalk.yellow( 'Treating warnings as errors because process.env.CI = true.\n' + 'Most CI servers set it automatically.' ) ); console.log(); return reject(new Error(messages.warnings.join('\n\n'))); } return resolve({ stats, previousFileSizes }); }); }); }
return reject(new Error(messages.errors.join('\n\n'))); if (process.env.CI && messages.warnings.length) { console.log( chalk.yellow(
return reject(new Error(messages.errors.join('\n\n'))); if (process.env.CI && messages.warnings.length) { console.log( chalk.yellow(
return reject(new Error(messages.errors.join('\n\n'))); if (process.env.CI && messages.warnings.length) { console.log( chalk.yellow(
return reject(new Error(messages.errors.join('\n\n'))); if (process.env.CI && messages.warnings.length) { console.log( chalk.yellow(