@@ -12,11 +12,15 @@ const proxyquire = require('proxyquire');
12
12
const sinon = require ( 'sinon' ) ;
13
13
const uniqueTempDir = require ( 'unique-temp-dir' ) ;
14
14
const execa = require ( 'execa' ) ;
15
+ const colors = require ( '../lib/colors' ) ;
15
16
16
17
const cliPath = path . join ( __dirname , '../cli.js' ) ;
17
18
18
19
// For some reason chalk is disabled by default
19
20
chalk . enabled = true ;
21
+ for ( const key of Object . keys ( colors ) ) {
22
+ colors [ key ] . enabled = true ;
23
+ }
20
24
21
25
function execCli ( args , opts , cb ) {
22
26
let dirname ;
@@ -70,12 +74,12 @@ function execCli(args, opts, cb) {
70
74
}
71
75
72
76
test ( 'disallow invalid babel config shortcuts' , t => {
73
- execCli ( ' es2015.js', { dirname : 'fixture/invalid-babel-config' } , ( err , stdout , stderr ) => {
77
+ execCli ( [ '--color' , ' es2015.js'] , { dirname : 'fixture/invalid-babel-config' } , ( err , stdout , stderr ) => {
74
78
t . ok ( err ) ;
75
79
76
80
let expectedOutput = '\n ' ;
77
- expectedOutput += figures . cross + ' Unexpected Babel configuration for AVA.' ;
78
- expectedOutput += ' See https://github.com/avajs/ava#es2015-support for allowed values.' ;
81
+ expectedOutput += colors . error ( figures . cross ) + ' Unexpected Babel configuration for AVA.' ;
82
+ expectedOutput += ' See ' + chalk . underline ( ' https://github.com/avajs/ava#es2015-support' ) + ' for allowed values.';
79
83
expectedOutput += '\n' ;
80
84
81
85
t . is ( stderr , expectedOutput ) ;
0 commit comments