@@ -26,8 +26,8 @@ const assert = require('assert');
26
26
assert . ok ( process . stdout . writable ) ;
27
27
assert . ok ( process . stderr . writable ) ;
28
28
// Support legacy API
29
- assert . strictEqual ( 'number' , typeof process . stdout . fd ) ;
30
- assert . strictEqual ( 'number' , typeof process . stderr . fd ) ;
29
+ assert . strictEqual ( typeof process . stdout . fd , 'number' ) ;
30
+ assert . strictEqual ( typeof process . stderr . fd , 'number' ) ;
31
31
32
32
assert . doesNotThrow ( function ( ) {
33
33
process . once ( 'warning' , common . mustCall ( ( warning ) => {
@@ -123,35 +123,35 @@ const expectedStrings = [
123
123
] ;
124
124
125
125
for ( const expected of expectedStrings ) {
126
- assert . strictEqual ( `${ expected } \n` , strings . shift ( ) ) ;
127
- assert . strictEqual ( `${ expected } \n` , errStrings . shift ( ) ) ;
126
+ assert . strictEqual ( strings . shift ( ) , `${ expected } \n` ) ;
127
+ assert . strictEqual ( errStrings . shift ( ) , `${ expected } \n` ) ;
128
128
}
129
129
130
130
for ( const expected of expectedStrings ) {
131
- assert . strictEqual ( `${ expected } \n` , strings . shift ( ) ) ;
132
- assert . strictEqual ( `${ expected } \n` , errStrings . shift ( ) ) ;
131
+ assert . strictEqual ( strings . shift ( ) , `${ expected } \n` ) ;
132
+ assert . strictEqual ( errStrings . shift ( ) , `${ expected } \n` ) ;
133
133
}
134
134
135
- assert . strictEqual ( "{ foo: 'bar', inspect: [Function: inspect] }\n" ,
136
- strings . shift ( ) ) ;
137
- assert . strictEqual ( "{ foo: 'bar', inspect: [Function: inspect] }\n" ,
138
- strings . shift ( ) ) ;
135
+ assert . strictEqual ( strings . shift ( ) ,
136
+ "{ foo: 'bar', inspect: [Function: inspect] }\n" ) ;
137
+ assert . strictEqual ( strings . shift ( ) ,
138
+ "{ foo: 'bar', inspect: [Function: inspect] }\n" ) ;
139
139
assert . ok ( strings . shift ( ) . includes ( 'foo: [Object]' ) ) ;
140
140
assert . strictEqual ( strings . shift ( ) . includes ( 'baz' ) , false ) ;
141
141
assert . ok ( / ^ l a b e l : \d + \. \d { 3 } m s $ / . test ( strings . shift ( ) . trim ( ) ) ) ;
142
142
assert . ok ( / ^ _ _ p r o t o _ _ : \d + \. \d { 3 } m s $ / . test ( strings . shift ( ) . trim ( ) ) ) ;
143
143
assert . ok ( / ^ c o n s t r u c t o r : \d + \. \d { 3 } m s $ / . test ( strings . shift ( ) . trim ( ) ) ) ;
144
144
assert . ok ( / ^ h a s O w n P r o p e r t y : \d + \. \d { 3 } m s $ / . test ( strings . shift ( ) . trim ( ) ) ) ;
145
145
146
- assert . strictEqual ( 'Trace: This is a {"formatted":"trace"} 10 foo' ,
147
- errStrings . shift ( ) . split ( '\n' ) . shift ( ) ) ;
146
+ assert . strictEqual ( errStrings . shift ( ) . split ( '\n' ) . shift ( ) ,
147
+ 'Trace: This is a {"formatted":"trace"} 10 foo' ) ;
148
148
149
- assert . throws ( ( ) => {
149
+ common . expectsError ( ( ) => {
150
150
console . assert ( false , 'should throw' ) ;
151
- } , common . expectsError ( {
151
+ } , {
152
152
code : 'ERR_ASSERTION' ,
153
153
message : / ^ s h o u l d t h r o w $ /
154
- } ) ) ;
154
+ } ) ;
155
155
156
156
assert . doesNotThrow ( ( ) => {
157
157
console . assert ( true , 'this should not throw' ) ;
0 commit comments