Skip to content

Commit

Permalink
test: fix invalid file: URL in test-fs-path-dir
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
aduh95 authored Oct 21, 2024
1 parent 11fbdd8 commit 7e60b5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/sequential/test-fs-path-dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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));
Expand Down

0 comments on commit 7e60b5e

Please sign in to comment.