Skip to content

Commit

Permalink
refactor: for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Nov 10, 2017
1 parent 6284aff commit e3584ea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/LineWriter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable complexity */
/* eslint-disable complexity, no-use-extend-native/no-use-extend-native */
const path = require('path');
const chalk = require('chalk');
const progressBar = require('./progressBar');
Expand Down Expand Up @@ -26,11 +26,16 @@ const PASS = chalk.supportsColor ?
` ${PASS_TEXT} `;

const formatComment = (line) => chalk`{hidden #} ${line}`;

const formatFailureMessageTraceLine = (description, relativeFilePath, row, column) =>
chalk`${description}({cyan ${relativeFilePath}}:{black.bold ${row}}:{black.bold ${column}})`;

const formatStatsBar = (percent, hasErrors) => {
// eslint-disable-next-line no-use-extend-native/no-use-extend-native
const percentFormatted = (Math.round(100 * percent) + '%').padStart(3, ' ').padEnd(4, ' ');
let percentFormatted = Math.round(100 * percent) + '%';

percentFormatted = percentFormatted.padStart(3, ' ');
percentFormatted = percentFormatted.padEnd(4, ' ');

const bar = progressBar(percent, hasErrors ? 'red' : 'grey.dim');

let textStyles = 'green';
Expand Down

0 comments on commit e3584ea

Please sign in to comment.