File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ let warn = true;
77
77
78
78
Object . defineProperty ( fs , 'promises' , {
79
79
configurable : true ,
80
- enumerable : true ,
80
+ enumerable : false ,
81
81
get ( ) {
82
82
if ( warn ) {
83
83
warn = false ;
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ const assert = require('assert');
5
5
const tmpdir = require ( '../common/tmpdir' ) ;
6
6
const fixtures = require ( '../common/fixtures' ) ;
7
7
const path = require ( 'path' ) ;
8
- const fsPromises = require ( 'fs' ) . promises ;
8
+ const fs = require ( 'fs' ) ;
9
+ const fsPromises = fs . promises ;
9
10
const {
10
11
access,
11
12
chmod,
@@ -38,6 +39,10 @@ const tmpDir = tmpdir.path;
38
39
39
40
common . crashOnUnhandledRejection ( ) ;
40
41
42
+ // fs.promises should not be enumerable as long as it causes a warning to be
43
+ // emitted.
44
+ assert . strictEqual ( Object . keys ( fs ) . includes ( 'promises' ) , false ) ;
45
+
41
46
{
42
47
access ( __filename , 'r' )
43
48
. then ( common . mustCall ( ) )
You can’t perform that action at this time.
0 commit comments