Skip to content

Commit ff7b144

Browse files
tchetwinruyadorno
authored andcommitted
test: convert readdir test to use test runner
Signed-off-by: tchetwin <tchetwin@bloomberg.net> PR-URL: #55750 Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 05d6227 commit ff7b144

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
'use strict';
2-
const common = require('../common');
3-
const fs = require('fs');
4-
const net = require('net');
52

3+
const { PIPE, mustCall } = require('../common');
64
const tmpdir = require('../common/tmpdir');
7-
tmpdir.refresh();
5+
const { test } = require('node:test');
6+
const fs = require('node:fs');
7+
const net = require('node:net');
88

9-
const server = net.createServer().listen(common.PIPE, common.mustCall(() => {
10-
// The process should not crash
11-
// See https://github.com/nodejs/node/issues/52159
12-
fs.readdirSync(tmpdir.path, { recursive: true });
13-
server.close();
14-
}));
9+
test('readdir should not recurse into Unix domain sockets', (t, done) => {
10+
tmpdir.refresh();
11+
const server = net.createServer().listen(PIPE, mustCall(() => {
12+
// The process should not crash
13+
// See https://github.com/nodejs/node/issues/52159
14+
fs.readdirSync(tmpdir.path, { recursive: true });
15+
server.close();
16+
done();
17+
}));
18+
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy