File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -61,3 +61,13 @@ assert.equal(typeof ('astring'.red), 'string');
6161assert . equal ( typeof ( 'astring' . error ) , 'string' ) ;
6262
6363assert . equal ( s , 'string' ) ;
64+
65+ colors . setTheme ( { custom : [ 'blue' , 'bold' , 'underline' ] } ) ;
66+ assert . equal ( colors . custom ( s ) ,
67+ '\x1b[34m' + '\x1b[1m' + '\x1b[4m' + s +
68+ '\x1b[24m' + '\x1b[22m' + '\x1b[39m' ) ;
69+
70+ colors . setTheme ( { custom : [ 'red' , 'italic' , 'inverse' ] } ) ;
71+ assert . equal ( colors . custom ( s ) ,
72+ '\x1b[31m' + '\x1b[3m' + '\x1b[7m' + s +
73+ '\x1b[27m' + '\x1b[23m' + '\x1b[39m' ) ;
Original file line number Diff line number Diff line change @@ -57,3 +57,12 @@ colors.setTheme({error: 'red'});
5757assert . equal ( typeof ( colors . red ( 'astring' ) ) , 'string' ) ;
5858assert . equal ( typeof ( colors . error ( 'astring' ) ) , 'string' ) ;
5959
60+ colors . setTheme ( { custom : [ 'blue' , 'bold' , 'underline' ] } ) ;
61+ assert . equal ( colors . custom ( s ) ,
62+ '\x1b[4m' + '\x1b[1m' + '\x1b[34m' + s +
63+ '\x1b[39m' + '\x1b[22m' + '\x1b[24m' ) ;
64+
65+ colors . setTheme ( { custom : [ 'red' , 'italic' , 'inverse' ] } ) ;
66+ assert . equal ( colors . custom ( s ) ,
67+ '\x1b[7m' + '\x1b[3m' + '\x1b[31m' + s +
68+ '\x1b[39m' + '\x1b[23m' + '\x1b[27m' ) ;
You can’t perform that action at this time.
0 commit comments