From 36ed81d77cff5f452348c74603cbc6bbbe2cb0f8 Mon Sep 17 00:00:00 2001 From: Ben Heidemann Date: Sun, 18 Apr 2021 14:32:38 +0100 Subject: [PATCH] test(#775): add regression test for issue #775 --- tests/bugs/issue775.js | 19 +++++++++++++++++++ tests/index.js | 1 + 2 files changed, 20 insertions(+) create mode 100644 tests/bugs/issue775.js diff --git a/tests/bugs/issue775.js b/tests/bugs/issue775.js new file mode 100644 index 0000000..a0f01bb --- /dev/null +++ b/tests/bugs/issue775.js @@ -0,0 +1,19 @@ +'use strict'; +const util = require('../lib/test-utils.js'); + +describe('fs.readdir fails when passing options, issue775', function () { + beforeEach(util.setup); + afterEach(util.cleanup); + + it('should create a directory then call fs.readdir with options', function (done) { + const fs = util.fs(); + fs.mkdir('/test_dir', undefined, (err) => { + if (err) { + done(err); + } + else { + fs.readdir('/test_dir', { withFileTypes: true }, done); + } + }); + }); +}); diff --git a/tests/index.js b/tests/index.js index b1215c8..f1dcfb0 100644 --- a/tests/index.js +++ b/tests/index.js @@ -92,6 +92,7 @@ require('./bugs/issue270.js'); require('./bugs/rename-dir-trailing-slash.js'); require('./bugs/issue357.js'); require('./bugs/issue773.js'); +require('./bugs/issue775.js'); require('./bugs/issue776.js'); // Sample code from README