@@ -42,34 +42,38 @@ describe("SyncAsyncFileSystemDecorator stat", function () {
42
42
describe ( "SyncAsyncFileSystemDecorator lstat" , function ( ) {
43
43
it ( "should use options when they're provided" , function ( done ) {
44
44
const decoratedFs = new SyncAsyncFileSystemDecorator ( fs ) ;
45
- decoratedFs . lstat (
46
- path . join ( __dirname , "fixtures" , "decorated-fs" , "exists.js" ) ,
47
- { bigint : true } ,
48
- function ( error , result ) {
49
- expect ( error ) . toBeNull ( ) ;
50
- expect ( result ) . toHaveProperty ( "size" ) ;
51
- expect ( result ) . toHaveProperty ( "birthtime" ) ;
52
- expect (
53
- typeof ( /** @type {import("fs").BigIntStats } */ ( result ) . size )
54
- ) . toEqual ( "bigint" ) ;
55
- done ( ) ;
56
- }
57
- ) ;
45
+ if ( decoratedFs . lstat ) {
46
+ decoratedFs . lstat (
47
+ path . join ( __dirname , "fixtures" , "decorated-fs" , "exists.js" ) ,
48
+ { bigint : true } ,
49
+ function ( error , result ) {
50
+ expect ( error ) . toBeNull ( ) ;
51
+ expect ( result ) . toHaveProperty ( "size" ) ;
52
+ expect ( result ) . toHaveProperty ( "birthtime" ) ;
53
+ expect (
54
+ typeof ( /** @type {import("fs").BigIntStats } */ ( result ) . size )
55
+ ) . toEqual ( "bigint" ) ;
56
+ done ( ) ;
57
+ }
58
+ ) ;
59
+ }
58
60
} ) ;
59
61
60
62
it ( "should work correctly when no options provided" , function ( done ) {
61
63
const decoratedFs = new SyncAsyncFileSystemDecorator ( fs ) ;
62
- decoratedFs . lstat (
63
- path . join ( __dirname , "fixtures" , "decorated-fs" , "exists.js" ) ,
64
- function ( error , result ) {
65
- expect ( error ) . toBeNull ( ) ;
66
- expect ( result ) . toHaveProperty ( "size" ) ;
67
- expect ( result ) . toHaveProperty ( "birthtime" ) ;
68
- expect (
69
- typeof ( /** @type {import("fs").Stats } */ ( result ) . size )
70
- ) . toEqual ( "number" ) ;
71
- done ( ) ;
72
- }
73
- ) ;
64
+ if ( decoratedFs . lstat ) {
65
+ decoratedFs . lstat (
66
+ path . join ( __dirname , "fixtures" , "decorated-fs" , "exists.js" ) ,
67
+ function ( error , result ) {
68
+ expect ( error ) . toBeNull ( ) ;
69
+ expect ( result ) . toHaveProperty ( "size" ) ;
70
+ expect ( result ) . toHaveProperty ( "birthtime" ) ;
71
+ expect (
72
+ typeof ( /** @type {import("fs").Stats } */ ( result ) . size )
73
+ ) . toEqual ( "number" ) ;
74
+ done ( ) ;
75
+ }
76
+ ) ;
77
+ }
74
78
} ) ;
75
79
} ) ;
0 commit comments