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,benchmark: use `tmpdir.fileURL()` · nodejs/node@b011a49

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark/esm
    • esm-loader-import.js
  • test
    • es-module
      • test-esm-dynamic-import-mutating-fs.js
      • test-esm-dynamic-import-mutating-fs.mjs
    • node-api/test_policy
      • test_policy.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎benchmark/esm/esm-loader-import.js‎

Copy file name to clipboardExpand all lines: benchmark/esm/esm-loader-import.js
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
// general startup, does not test lazy operations
33
'use strict';
44
const fs = require('node:fs');
5-
const path = require('node:path');
65
const common = require('../common.js');
76

87
const tmpdir = require('../../test/common/tmpdir.js');
9-
const { pathToFileURL } = require('node:url');
108

11-
const benchmarkDirectory = pathToFileURL(path.resolve(tmpdir.path, 'benchmark-import'));
9+
const benchmarkDirectory = tmpdir.fileURL('benchmark-import');
1210

1311
const configs = {
1412
n: [1e3],
Collapse file

‎test/es-module/test-esm-dynamic-import-mutating-fs.js‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-dynamic-import-mutating-fs.js
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ const tmpdir = require('../common/tmpdir');
44

55
const assert = require('node:assert');
66
const fs = require('node:fs/promises');
7-
const { pathToFileURL } = require('node:url');
87

98
tmpdir.refresh();
10-
const tmpDir = pathToFileURL(tmpdir.path);
11-
12-
const target = new URL(`./${Math.random()}.mjs`, tmpDir);
9+
const target = tmpdir.fileURL(`${Math.random()}.mjs`);
1310

1411
(async () => {
1512

Collapse file

‎test/es-module/test-esm-dynamic-import-mutating-fs.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-dynamic-import-mutating-fs.mjs
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ import tmpdir from '../common/tmpdir.js';
44
import assert from 'node:assert';
55
import fs from 'node:fs/promises';
66
import { execPath } from 'node:process';
7-
import { pathToFileURL } from 'node:url';
87

98
tmpdir.refresh();
10-
const tmpDir = pathToFileURL(tmpdir.path);
11-
12-
const target = new URL(`./${Math.random()}.mjs`, tmpDir);
9+
const target = tmpdir.fileURL(`${Math.random()}.mjs`);
1310

1411
await assert.rejects(import(target), { code: 'ERR_MODULE_NOT_FOUND' });
1512

Collapse file

‎test/node-api/test_policy/test_policy.js‎

Copy file name to clipboardExpand all lines: test/node-api/test_policy/test_policy.js
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ const policyFilepath = path.join(tmpdir.path, 'policy');
2424
const depFilepath = require.resolve(`./build/${common.buildType}/binding.node`);
2525
const depURL = pathToFileURL(depFilepath);
2626

27-
const tmpdirURL = pathToFileURL(tmpdir.path);
28-
if (!tmpdirURL.pathname.endsWith('/')) {
29-
tmpdirURL.pathname += '/';
30-
}
31-
3227
const depBody = fs.readFileSync(depURL);
3328
function writePolicy(...resources) {
3429
const manifest = { resources: {} };

0 commit comments

Comments
0 (0)
You are visitor 01402503 — 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.