All files message.ts

100% Statements 14/14
100% Branches 8/8
100% Functions 1/1
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151x 1x 1x   1x 5x 1x 1x   4x 3x 2x 1x    
const chalk = require('chalk');
const shelljs = require('shelljs');
const emoji = require('node-emoji');
 
module.exports = (type: string, message: string) => {
  if (type === 'exit') {
    console.log(`\n\n${emoji.get('poop')} ${message}\n`);
    return shelljs.exit(1);
  }
  if (type === 'complete') return console.log(`\n\n${emoji.get('rocket')} ${message}\n`);
  if (type === 'failure') return console.log(chalk.black.bgRed('\n failure '), chalk.red(message));
  if (type === 'warning') return console.log(chalk.black.bgYellow('\n warning '), chalk.yellow(message));
  return console.log(chalk.black.bgGreen('\n success '), chalk.green(message));
};