node/test/parallel/test-fs-readdir-pipe.js
Hüseyin Açacak f184a0aca0
fs,win: fix readdir for named pipe
PR-URL: https://github.com/nodejs/node/pull/56110
Fixes: https://github.com/nodejs/node/issues/56002
Refs: https://github.com/nodejs/node/pull/55623
Refs: https://github.com/nodejs/node/pull/56088
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-12-10 13:31:21 +00:00

22 lines
595 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const { readdir, readdirSync } = require('fs');
if (!common.isWindows) {
common.skip('This test is specific to Windows to test enumerate pipes');
}
// Ref: https://github.com/nodejs/node/issues/56002
// This test is specific to Windows.
const pipe = '\\\\.\\pipe\\';
const { length } = readdirSync(pipe);
assert.ok(length >= 0, `${length} is not greater or equal to 0`);
readdir(pipe, common.mustSucceed((files) => {
assert.ok(files.length >= 0, `${files.length} is not greater or equal to 0`);
}));