@@ -35,16 +35,12 @@ assert.throws(() => {
35
35
} , {
36
36
code : 'ERR_INVALID_ARG_VALUE' ,
37
37
} ) ;
38
- assert . throws ( ( ) => {
39
- util . styleText ( [ 'invalid' ] , 'text' ) ;
40
- } , {
41
- code : 'ERR_INVALID_ARG_VALUE' ,
42
- } ) ;
43
38
44
39
assert . strictEqual (
45
40
util . styleText ( 'red' , 'test' , { validateStream : false } ) ,
46
41
'\u001b[31mtest\u001b[39m' ,
47
42
) ;
43
+
48
44
assert . strictEqual (
49
45
util . styleText ( [ 'bold' , 'red' ] , 'test' , { validateStream : false } ) ,
50
46
'\u001b[1m\u001b[31mtest\u001b[39m\u001b[22m' ,
@@ -59,14 +55,21 @@ assert.strictEqual(
59
55
) ,
60
56
) ;
61
57
58
+ assert . throws ( ( ) => {
59
+ util . styleText ( [ 'invalid' ] , 'text' ) ;
60
+ } , {
61
+ code : 'ERR_INVALID_ARG_VALUE' ,
62
+ } ) ;
63
+
62
64
assert . throws ( ( ) => {
63
65
util . styleText ( 'red' , 'text' , { stream : { } } ) ;
64
66
} , {
65
67
code : 'ERR_INVALID_ARG_TYPE' ,
66
68
} ) ;
67
69
68
- // doesn't throw
70
+ // does not throw
69
71
util . styleText ( 'red' , 'text' , { stream : { } , validateStream : false } ) ;
72
+
70
73
assert . strictEqual (
71
74
util . styleText ( 'red' , 'test' , { validateStream : false } ) ,
72
75
styled ,
0 commit comments