Skip to content

Commit 6f7379a

Browse files
committed
test: fix invalid file: URL in test-fs-path-dir
PR-URL: #55454 Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 2147e49 commit 6f7379a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/sequential/test-fs-path-dir.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const tmpdir = require('../common/tmpdir');
55
const assert = require('assert');
66
const path = require('path');
77
const fs = require('fs');
8-
const URL = require('url').URL;
8+
const { pathToFileURL } = require('url');
99

1010
tmpdir.refresh();
1111

@@ -15,7 +15,7 @@ const nextFile = () => path.join(tmpdir.path, `file${fileCounter++}`);
1515
const generateStringPath = (file, suffix = '') => file + suffix;
1616

1717
const generateURLPath = (file, suffix = '') =>
18-
new URL('file://' + path.resolve(file) + suffix);
18+
pathToFileURL(file + suffix);
1919

2020
const generateUint8ArrayPath = (file, suffix = '') =>
2121
new Uint8Array(Buffer.from(file + suffix));

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