Browse files

s/supports-color/color-support/g

  • Loading branch information...
1 parent 6eb21aa commit f068025a2b2f49c70b4eefde6ab2511750efed35 @isaacs isaacs committed Jul 17, 2016
Showing with 10 additions and 7 deletions.
  1. +9 −6 bin/run.js
  2. +1 −1 package.json
View
15 bin/run.js
@@ -4,7 +4,7 @@ var fs = require('fs')
var spawn = require('child_process').spawn
var fg = require('foreground-child')
var opener = require('opener')
-var supportsColor = require('supports-color')
+var colorSupport = require('color-support')
var nycBin = require.resolve('nyc/bin/nyc.js')
var glob = require('glob')
var isexe = require('isexe')
@@ -121,7 +121,7 @@ function constructDefaultArgs () {
nycArgs: [],
testArgs: [],
timeout: +process.env.TAP_TIMEOUT || defaultTimeout,
- color: supportsColor,
+ color: !!colorSupport.level,
reporter: null,
files: [],
bail: false,
@@ -589,13 +589,17 @@ function globFiles (files) {
}, [])
}
-function stdinOnly (options) {
+function makeReporter (options) {
var TMR = require('tap-mocha-reporter')
+ return new TMR(options.reporter)
+}
+
+function stdinOnly (options) {
// if we didn't specify any files, then just passthrough
// to the reporter, so we don't get '/dev/stdin' in the suite list.
// We have to pause() before piping to switch streams2 into old-mode
process.stdin.pause()
- var reporter = new TMR(options.reporter)
+ var reporter = makeReporter(options)
process.stdin.pipe(reporter)
process.stdin.resume()
}
@@ -695,9 +699,8 @@ function runTests (options) {
// if not -Rtap, then output what the user wants.
if (options.reporter !== 'tap') {
- var TMR = require('tap-mocha-reporter')
tap.unpipe(process.stdout)
- tap.pipe(new TMR(options.reporter))
+ tap.pipe(makeReporter(options))
}
saveFails(options, tap)
View
2 package.json
@@ -14,6 +14,7 @@
"dependencies": {
"bluebird": "^3.3.1",
"clean-yaml-object": "^0.1.0",
+ "color-support": "^1.1.0",
"coveralls": "^2.11.2",
"deeper": "^2.1.0",
"foreground-child": "^1.3.3",
@@ -27,7 +28,6 @@
"readable-stream": "^2.0.2",
"signal-exit": "^3.0.0",
"stack-utils": "^0.4.0",
- "supports-color": "^1.3.1",
"tap-mocha-reporter": "0.0 || 1",
"tap-parser": "^1.2.2",
"tmatch": "^2.0.1"

0 comments on commit f068025

Please sign in to comment.