File tree 1 file changed +14
-8
lines changed
1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
+ const assert = require ( 'node:assert' ) ;
3
+ const { describe, it } = require ( 'node:test' ) ;
4
+
2
5
const common = require ( '../common' ) ;
3
6
const fs = require ( 'fs' ) ;
4
7
5
8
if ( ! common . isMacOS ) {
6
9
common . skip ( 'this tests works only on MacOS' ) ;
7
10
}
8
11
9
- const assert = require ( 'assert' ) ;
10
-
11
- fs . readdir (
12
- Buffer . from ( '/dev' ) ,
13
- { withFileTypes : true , encoding : 'buffer' } ,
14
- common . mustCall ( ( e , d ) => {
15
- assert . strictEqual ( e , null ) ;
12
+ describe ( 'fs.readdir from buffer' , ( ) => {
13
+ it ( 'it should read from the buffer' , async ( ) => {
14
+ const result = await new Promise ( resolve => {
15
+ fs . readdir (
16
+ Buffer . from ( '/dev' ) ,
17
+ { withFileTypes : true , encoding : 'buffer' } ,
18
+ common . mustCall ( ( e , d ) => resolve ( e ) )
19
+ ) ;
20
+ } )
21
+ assert . strictEqual ( result , null ) ;
16
22
} )
17
- ) ;
23
+ } ) ;
You can’t perform that action at this time.
0 commit comments