Skip to content

Commit 7311ee2

Browse files
committed
Test guarded access to stats in fs.statSync() wrapper
Adds extra test that’s left over from an attempted alternative to 14aaa19.
1 parent 9681d92 commit 7311ee2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/stats-uid-gid.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,16 @@ test('graceful fs uses same stats constructor as fs', function (t) {
2929
})
3030

3131
test('does not throw when async stat fails', function (t) {
32-
fs.stat(__filename + ' this does not exist', function (er, stats) {
32+
gfs.stat(__filename + ' this does not exist', function (er, stats) {
3333
t.ok(er)
3434
t.notOk(stats)
3535
t.end()
3636
})
3737
})
38+
39+
test('does not throw when async stat fails', function (t) {
40+
t.throws(function() {
41+
gfs.statSync(__filename + ' this does not exist')
42+
}, /ENOENT/)
43+
t.end()
44+
})

0 commit comments

Comments
 (0)