mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: fix invalid file:
URL in test-fs-path-dir
PR-URL: https://github.com/nodejs/node/pull/55454 Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
11fbdd8c9d
commit
7e60b5e15b
@ -5,7 +5,7 @@ const tmpdir = require('../common/tmpdir');
|
||||
const assert = require('assert');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const URL = require('url').URL;
|
||||
const { pathToFileURL } = require('url');
|
||||
|
||||
tmpdir.refresh();
|
||||
|
||||
@ -15,7 +15,7 @@ const nextFile = () => path.join(tmpdir.path, `file${fileCounter++}`);
|
||||
const generateStringPath = (file, suffix = '') => file + suffix;
|
||||
|
||||
const generateURLPath = (file, suffix = '') =>
|
||||
new URL('file://' + path.resolve(file) + suffix);
|
||||
pathToFileURL(file + suffix);
|
||||
|
||||
const generateUint8ArrayPath = (file, suffix = '') =>
|
||||
new Uint8Array(Buffer.from(file + suffix));
|
||||
|
Loading…
Reference in New Issue
Block a user