GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: use common.PIPE in fs.cp socket tests · nodejs/node@ae9c25a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-fs-cp-async-socket.mjs
    • test-fs-cp-sync-copy-socket-error.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-fs-cp-async-socket.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-cp-async-socket.mjs
+3-7Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import * as common from '../common/index.mjs';
44
import assert from 'node:assert';
5-
import { cp, mkdirSync } from 'node:fs';
5+
import { cp } from 'node:fs';
66
import { createServer } from 'node:net';
7-
import { join } from 'node:path';
87
import { nextdir } from '../common/fs.js';
98
import tmpdir from '../common/tmpdir.js';
109

@@ -21,13 +20,10 @@ if (common.isInsideDirWithUnusualChars) {
2120
tmpdir.refresh();
2221

2322
{
24-
const src = nextdir();
25-
mkdirSync(src);
2623
const dest = nextdir();
27-
const sock = join(src, `${process.pid}.sock`);
2824
const server = createServer();
29-
server.listen(sock);
30-
cp(sock, dest, common.mustCall((err) => {
25+
server.listen(common.PIPE);
26+
cp(common.PIPE, dest, common.mustCall((err) => {
3127
assert.strictEqual(err.code, 'ERR_FS_CP_SOCKET');
3228
server.close();
3329
}));
Collapse file

‎test/parallel/test-fs-cp-sync-copy-socket-error.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-cp-sync-copy-socket-error.mjs
+3-7Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
import * as common from '../common/index.mjs';
33
import { nextdir } from '../common/fs.js';
44
import assert from 'node:assert';
5-
import { cpSync, mkdirSync } from 'node:fs';
5+
import { cpSync } from 'node:fs';
66
import { createServer } from 'node:net';
7-
import { join } from 'node:path';
87
import tmpdir from '../common/tmpdir.js';
98

109
const isWindows = process.platform === 'win32';
@@ -20,14 +19,11 @@ if (common.isInsideDirWithUnusualChars) {
2019
tmpdir.refresh();
2120

2221
{
23-
const src = nextdir();
24-
mkdirSync(src);
2522
const dest = nextdir();
26-
const sock = join(src, `${process.pid}.sock`);
2723
const server = createServer();
28-
server.listen(sock);
24+
server.listen(common.PIPE);
2925
assert.throws(
30-
() => cpSync(sock, dest),
26+
() => cpSync(common.PIPE, dest),
3127
{ code: 'ERR_FS_CP_SOCKET' }
3228
);
3329
server.close();

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.