@@ -4,7 +4,7 @@ const fs = require("fs");
4
4
const path = require ( "path" ) ;
5
5
const SyncAsyncFileSystemDecorator = require ( "../lib/SyncAsyncFileSystemDecorator" ) ;
6
6
7
- describe ( "SyncAsyncFileSystemDecorator stat" , function ( ) {
7
+ describe ( "SyncAsyncFileSystemDecorator stat" , function ( ) {
8
8
it ( "should use options when they're provided" , function ( done ) {
9
9
const decoratedFs = new SyncAsyncFileSystemDecorator ( fs ) ;
10
10
decoratedFs . stat (
@@ -38,3 +38,38 @@ describe("SyncAsyncFileSystemDecorator stat", function () {
38
38
) ;
39
39
} ) ;
40
40
} ) ;
41
+
42
+ describe ( "SyncAsyncFileSystemDecorator lstat" , function ( ) {
43
+ it ( "should use options when they're provided" , function ( done ) {
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
+ ) ;
58
+ } ) ;
59
+
60
+ it ( "should work correctly when no options provided" , function ( done ) {
61
+ 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
+ ) ;
74
+ } ) ;
75
+ } ) ;
0 commit comments