11'use strict' ;
22
33require ( '../common' ) ;
4- const { strictEqual , throws } = require ( 'assert' ) ;
4+ const assert = require ( 'node: assert' ) ;
55const { guessFileDescriptorType } = require ( 'os' ) ;
66
7- strictEqual ( guessFileDescriptorType ( 0 ) , 'TTY' , 'stdin reported to not be a tty, but it is ') ;
8- strictEqual ( guessFileDescriptorType ( 1 ) , 'TTY' , 'stdout reported to not be a tty, but it is ') ;
9- strictEqual ( guessFileDescriptorType ( 2 ) , 'TTY' , 'stderr reported to not be a tty, but it is ') ;
7+ assert . strictEqual ( guessFileDescriptorType ( 0 ) , 'TTY' ) ;
8+ assert . strictEqual ( guessFileDescriptorType ( 1 ) , 'TTY' ) ;
9+ assert . strictEqual ( guessFileDescriptorType ( 2 ) , 'TTY' ) ;
1010
11- strictEqual ( guessFileDescriptorType ( 55555 ) , 'UNKNOWN' , '55555 reported to be a handle, but it is not ') ;
12- strictEqual ( guessFileDescriptorType ( 2 ** 31 - 1 ) , 'UNKNOWN' , '2^31-1 reported to be a handle, but it is not ') ;
11+ assert . strictEqual ( guessFileDescriptorType ( 55555 ) , 'UNKNOWN' ) ;
12+ assert . strictEqual ( guessFileDescriptorType ( 2 ** 31 - 1 ) , 'UNKNOWN' ) ;
1313
1414[
1515 - 1 ,
@@ -25,4 +25,4 @@ strictEqual(guessFileDescriptorType(2 ** 31 - 1), 'UNKNOWN', '2^31-1 reported to
2525 Symbol ( ) ,
2626 undefined ,
2727 null ,
28- ] . forEach ( ( val ) => throws ( ( ) => guessFileDescriptorType ( val ) , { code : 'ERR_INVALID_FD' } ) ) ;
28+ ] . forEach ( ( val ) => assert . throws ( ( ) => guessFileDescriptorType ( val ) , { code : 'ERR_INVALID_FD' } ) ) ;
0 commit comments