-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Only forward color
flag to worker if supplied by user
#1401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,9 +1,9 @@ | ||||
'use strict'; | ||||
const chalk = require('chalk'); | ||||
|
||||
// Check if the test is being run without AVA cli | ||||
{ | ||||
const path = require('path'); | ||||
const chalk = require('chalk'); | ||||
|
||||
const isForked = typeof process.send === 'function'; | ||||
if (!isForked) { | ||||
|
@@ -27,6 +27,9 @@ globals.options = opts; | |||
|
||||
const serializeError = require('./serialize-error'); | ||||
|
||||
// Initialize color support | ||||
chalk.enabled = typeof opts.color === 'boolean' && opts.color; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 78 in 1df502d
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I did this just to make this test pass since it doesn't run the CLI. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's an odd test. Just remove it 😄 |
||||
|
||||
(opts.require || []).forEach(require); | ||||
|
||||
adapter.installSourceMapSupport(); | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import test from '../../'; | ||
|
||
test(t => { | ||
t.is(process.argv[2], undefined); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import test from '../../'; | ||
|
||
test(t => { | ||
t.is(process.argv[2], '--color'); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import test from '../../'; | ||
|
||
test(t => { | ||
t.is(process.argv[2], '--no-color'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this forward
--no-color
if specified? And forward--color
exactly as it was received?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To forward them exactly like they were received requires some sort of parsing. We can forward
--no-color
instead of--color=false
if it was specified though.