Skip to content

Commit

Permalink
test: convert readdir test to use test runner
Browse files Browse the repository at this point in the history
Signed-off-by: tchetwin <[email protected]>
  • Loading branch information
tchetwin committed Nov 6, 2024
1 parent 6f12f1e commit 9857f8e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions test/parallel/test-fs-readdir-recursive.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
'use strict';

Check failure on line 1 in test/parallel/test-fs-readdir-recursive.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Mandatory module "common" must be loaded before any other modules

const { test } = require('node:test');
const common = require('../common');
const tmpdir = require('../common/tmpdir');
const fs = require('fs');
const net = require('net');

const tmpdir = require('../common/tmpdir');
tmpdir.refresh();

const server = net.createServer().listen(common.PIPE, common.mustCall(() => {
// The process should not crash
// See https://github.com/nodejs/node/issues/52159
fs.readdirSync(tmpdir.path, { recursive: true });
server.close();
}));
test('readdir should not recurse into Unix domain sockets', async () => {
tmpdir.refresh();
const server = net.createServer().listen(common.PIPE, common.mustCall(() => {
// The process should not crash
// See https://github.com/nodejs/node/issues/52159
fs.readdirSync(tmpdir.path, { recursive: true });
server.close();
}));
});

0 comments on commit 9857f8e

Please sign in to comment.