File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ import '../common/index.mjs' ;
2+ import assert from 'node:assert' ;
3+ import { promisify } from 'node:util' ;
4+
5+ // Test that customly promisified methods in [util.promisify.custom]
6+ // have appropriate names
7+
8+ import fs from 'node:fs' ;
9+ import readline from 'node:readline' ;
10+ import stream from 'node:stream' ;
11+ import timers from 'node:timers' ;
12+
13+
14+ assert . strictEqual (
15+ promisify ( fs . exists ) . name ,
16+ 'exists'
17+ ) ;
18+
19+ assert . strictEqual (
20+ promisify ( readline . Interface . prototype . question ) . name ,
21+ 'question' ,
22+ ) ;
23+
24+ assert . strictEqual (
25+ promisify ( stream . finished ) . name ,
26+ 'finished'
27+ ) ;
28+ assert . strictEqual (
29+ promisify ( stream . pipeline ) . name ,
30+ 'pipeline'
31+ ) ;
32+
33+ assert . strictEqual (
34+ promisify ( timers . setImmediate ) . name ,
35+ 'setImmediate'
36+ ) ;
37+ assert . strictEqual (
38+ promisify ( timers . setTimeout ) . name ,
39+ 'setTimeout'
40+ ) ;
You can’t perform that action at this time.
0 commit comments