From ccd6228b78da9b55572145fa11e81dc923f4c397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= <18708370+Flarna@users.noreply.github.com> Date: Sat, 30 Nov 2024 00:01:15 +0100 Subject: [PATCH] test: verify win named pipe enumeration Add a test to verify named pipe enumeration in windows works. --- test/parallel/test-fs-readdir-pipe.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/parallel/test-fs-readdir-pipe.js diff --git a/test/parallel/test-fs-readdir-pipe.js b/test/parallel/test-fs-readdir-pipe.js new file mode 100644 index 00000000000000..6a07b63b479cf0 --- /dev/null +++ b/test/parallel/test-fs-readdir-pipe.js @@ -0,0 +1,21 @@ +'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'; + +assert.ok(readdirSync(pipe).length >= 0); + +readdir(pipe, common.mustCall((err, files) => { + assert.ok(err == null); + assert.ok(files.length >= 0); +}));