Skip to content

Commit 9c3c424

Browse files
coreyfarrellbcoe
authored andcommittedNov 11, 2019
chore: 100% coverage. (#69)
1 parent c7e5336 commit 9c3c424

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed
 

‎index.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ function _minWidth (col) {
317317
}
318318

319319
function getWindowWidth () {
320+
/* istanbul ignore next: depends on terminal */
320321
if (typeof process === 'object' && process.stdout && process.stdout.columns) {
321322
return process.stdout.columns
322323
}
@@ -337,16 +338,17 @@ function alignCenter (str, width) {
337338
str = str.trim()
338339
const strWidth = stringWidth(str)
339340

340-
if (strWidth < width) {
341-
return ' '.repeat((width - strWidth) >> 1) + str
341+
/* istanbul ignore next */
342+
if (strWidth >= width) {
343+
return str
342344
}
343345

344-
return str
346+
return ' '.repeat((width - strWidth) >> 1) + str
345347
}
346348

347349
module.exports = function (opts = {}) {
348350
return new UI({
349-
width: opts.width || getWindowWidth() || 80,
351+
width: opts.width || getWindowWidth() || /* istanbul ignore next */ 80,
350352
wrap: opts.wrap !== false
351353
})
352354
}

‎nyc.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict'
2+
3+
module.exports = {
4+
checkCoverage: true,
5+
functions: 100,
6+
lines: 100,
7+
branches: 100,
8+
statements: 100
9+
}

0 commit comments

Comments
 (0)
Please sign in to comment.