Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('print', () => {
print('print!');
expect(console.log).toBeCalledWith(
`${chalk.green(figures.pointer)} print!`
);
});
'use strict';
const isCI = require('is-ci');
const chalk = require('chalk');
const logSymbols = require('log-symbols');
const figures = require('figures');
const elegantSpinner = require('elegant-spinner');
const logUpdate = require('log-update');
const indentString = require('indent-string');
const pointer = chalk.yellow(figures.pointer);
const skipped = chalk.yellow(figures.arrowDown);
const isDefined = x => x !== null && x !== undefined;
const getSymbol = (task, options) => {
if (!task.spinner) {
task.spinner = elegantSpinner();
}
if (task.isPending()) {
return options.showSubtasks !== false && task.subtasks.length > 0 ? pointer : chalk.yellow(task.spinner());
}
if (task.isCompleted()) {
return logSymbols.success;
}
choices.forEach(function(choice, i) {
if (choice.type === 'separator') {
separatorOffset++;
output += ' ' + choice + '\n';
return;
}
if (choice.disabled) {
separatorOffset++;
output += ' - ' + choice.name;
output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')';
} else {
var line = getCheckbox(choice.checked) + ' ' + choice.name;
if (i - separatorOffset === pointer) {
output += chalk.cyan(figures.pointer + line);
} else {
output += ' ' + line;
}
}
output += '\n';
});
choices.forEach(function(choice, i) {
if (choice.type === 'separator') {
separatorOffset++;
output += ' ' + choice + '\n';
return;
}
var isSelected = (i - separatorOffset === pointer);
var line = (isSelected ? figures.pointer + ' ' : ' ') + choice.name;
if (isSelected) {
line = log.cyan(line);
}
output += line + ' \n';
});
choices.forEach(function (choice, i) {
if (choice.type === 'separator') {
separatorOffset++;
output += ' ' + choice + '\n';
return;
}
var isSelected = (i - separatorOffset === pointer);
var line = (isSelected ? figures.pointer + ' ' : ' ') + choice.name;
if (isSelected) {
line = chalk.cyan(line);
}
output += line + ' \n';
});
choices.forEach(function (choice, i) {
if (choice.type === 'separator') {
separatorOffset++;
output += ' ' + choice + '\n';
return;
}
if (choice.disabled) {
separatorOffset++;
output += ' - ' + choice.name;
output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')';
} else {
var line = getCheckbox(choice.checked) + ' ' + choice.name;
if (i - separatorOffset === pointer) {
output += chalk.cyan(figures.pointer + line);
} else {
output += ' ' + line;
}
}
output += '\n';
});
choices.forEach(function(choice, i) {
if (choice.type === 'separator') {
separatorOffset++;
output += ' ' + choice + '\n';
return;
}
var isSelected = i - separatorOffset === pointer;
var line = (isSelected ? figures.pointer + ' ' : ' ') + choice.name;
if (isSelected) {
line = chalk.cyan(line);
}
output += line + ' \n';
});
import chalk from 'chalk'
import figures from 'figures'
export const DEBUG_ICON = chalk.magenta(figures.pointer)
export const INFO_ICON = chalk.blue(figures.info)
export const WARNING_ICON = chalk.yellow(figures.warning)
export const ERROR_ICON = chalk.red(figures.cross)
export const SUCCESS_ICON = chalk.green(figures.tick)
function parallelSpawn(commands, options = {}) {
const symbol = figures.pointer + figures.pointer
commands = commands.map(([bin, args, opts]) => [
bin,
args,
Object.assign({}, opts, options)
])
log(`${symbol} Running ${commands.length} commands in parallel.`.cyan)
return spawnList(commands, {concurrent: true})
.then(() => log(`${commands.length} commands run successfully.`.green))
.catch(showError)
}
if (choice.type === 'separator') {
separatorOffset++;
output += ' ' + choice + '\n';
return;
}
if (choice.disabled) {
separatorOffset++;
output += ' - ' + choice.name;
output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')';
output += '\n';
return;
}
var isSelected = i - separatorOffset === pointer;
var line = (isSelected ? figures.pointer + ' ' : ' ') + choice.name;
if (isSelected) {
line = chalk.cyan(line);
}
output += line + ' \n';
});