Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function exit(message) {
console.error(`\n ${require('./chalk').get().red(figures.cross)} ${message}`);
process.exit(1); // eslint-disable-line unicorn/no-process-exit
}
execCli(['es2015.js'], {dirname: `fixture/invalid-babel-config/${which}`}, (err, stdout, stderr) => {
t.ok(err);
let expectedOutput = '\n ';
expectedOutput += figures.cross + ' Unexpected Babel configuration for AVA.';
expectedOutput += ` See https://github.com/avajs/ava/blob/v${pkg.version}/docs/recipes/babel.md for allowed values.`;
expectedOutput += '\n';
t.is(stderr, expectedOutput);
t.end();
});
});
const testFail = (provider, consumer, name, error) => {
const cross = ` ${figures.cross} `
const message = `Test ${name} failed for ${consumer} against ${provider}\n`
const errorDetails = ` ${error}`
return chalk.red(`${cross}${message}${errorDetails}`)
}
formatContainerStatus (status) {
if (status.match(/^Up/)) {
return status.replace(/Up/, figures.tick)
}
if (status.match(/^Exited \(\d+\)/)) {
return status.replace(/^Exited \(\d+\)/, figures.cross)
}
return status
}
function bool2Symbol(pBool) {
return pBool ? chalk.green(figures.tick) : chalk.red(figures.cross);
}
color: Chalk;
icon: string;
verbose?: boolean;
}
const levelOptions: LevelOptions[] = [
{
level: Level.Debug,
color: chalk.gray,
icon: figures.bullet,
verbose: true
},
{ level: Level.Info, color: chalk.blue, icon: figures.info },
{ level: Level.Success, color: chalk.green, icon: figures.tick },
{ level: Level.Warn, color: chalk.yellow, icon: figures.warning },
{ level: Level.Error, color: chalk.red, icon: figures.cross }
];
const maxLevelLength = Math.max(
...levelOptions.map(getPrefix).map(stringWidth)
);
function getPrefix(opt: LevelOptions) {
return `${opt.icon} ${opt.level}`;
}
function buildLogFunc(writer: Writable, opt: LevelOptions) {
let prefix = getPrefix(opt);
for (let i = prefix.length; i <= maxLevelLength; i++) {
prefix += " ";
}
failed(test) {
print(` ${colors.red.bold(`${figures.cross} FAILED`)} ${colors.grey(`in ${test.duration}ms`)}`);
print();
},
},
'use strict';
const figures = require('figures');
module.exports = {
error: {
badge: figures.cross,
color: 'red',
label: 'error',
logLevel: 'error'
},
fatal: {
badge: figures.cross,
color: 'red',
label: 'fatal',
logLevel: 'error'
},
fav: {
badge: figures('❤'),
color: 'magenta',
label: 'favorite',
logLevel: 'info'
},
info: {
badge: figures.info,
color: 'blue',
label: 'info',
logLevel: 'info'
},