Skip to content

Commit

Permalink
Merge pull request #43 from MailOnline/pr/40
Browse files Browse the repository at this point in the history
Pr/40
  • Loading branch information
streamich authored Dec 13, 2017
2 parents 7099d29 + c51a0d0 commit 84091db
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ after_success:
branches:
except:
- /^v\d+\.\d+\.\d+$/
node_js:
- '9'
- '8'
- '7'
- '6'
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,22 @@
"index.js"
],
"reporters": [
["./", {
"logLevel": "INFO",
"showInternalStackTraces": false
}]
[
"./",
{
"logLevel": "INFO",
"showInternalStackTraces": false
}
]
],
"testRegex": "(test|src)\\/.+\\.(test|spec)\\.jsx?$"
},
"dependencies": {
"@babel/code-frame": "7.0.0-beta.34",
"chalk": "^2.3.0",
"string.prototype.padend": "^3.0.0",
"string.prototype.padstart": "^3.0.0",
"strip-ansi": "4.0.0",
"utf8-bar": "0.1.0",
"@babel/code-frame": "7.0.0-beta.34"
"utf8-bar": "0.1.0"
}
}
3 changes: 2 additions & 1 deletion src/LineWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const path = require('path');
const chalk = require('chalk');
const bar = require('utf8-bar');
const padEnd = require('string.prototype.padend');
const formatComment = require('./format/formatComment');
const formatCodeFrame = require('./format/formatCodeFrame');
const formatStatsBar = require('./format/formatStatsBar');
Expand Down Expand Up @@ -80,7 +81,7 @@ class LineWriter {

keyValue (key, value) {
// eslint-disable-next-line no-use-extend-native/no-use-extend-native
const keyFormatted = (key + ':').padEnd(12, ' ');
const keyFormatted = padEnd(key + ':', 12, ' ');

this.comment(chalk`{bold ${keyFormatted}} ${value}`);
}
Expand Down
6 changes: 4 additions & 2 deletions src/format/formatStatsBar.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const chalk = require('chalk');
const padEnd = require('string.prototype.padend');
const padStart = require('string.prototype.padstart');
const progressBar = require('../progressBar');

const formatStatsBar = (percent, hasErrors) => {
let percentFormatted = Math.round(100 * percent) + '%';

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

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

Expand Down

0 comments on commit 84091db

Please sign in to comment.