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: fix `es-module/test-esm-initialization` · nodejs/node@f02637e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/es-module
    • test-esm-initialization.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/es-module/test-esm-initialization.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-initialization.mjs
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,23 @@ import { describe, it } from 'node:test';
88
describe('ESM: ensure initialization happens only once', { concurrency: true }, () => {
99
it(async () => {
1010
const { code, stderr, stdout } = await spawnPromisified(execPath, [
11+
'--experimental-import-meta-resolve',
1112
'--loader',
1213
fixtures.fileURL('es-module-loaders', 'loader-resolve-passthru.mjs'),
1314
'--no-warnings',
1415
fixtures.path('es-modules', 'runmain.mjs'),
1516
]);
1617

17-
// Length minus 1 because the first match is the needle.
18-
const resolveHookRunCount = (stdout.match(/resolve passthru/g)?.length ?? 0) - 1;
19-
2018
assert.strictEqual(stderr, '');
2119
/**
2220
* resolveHookRunCount = 2:
2321
* 1. fixtures/…/runmain.mjs
2422
* 2. node:module (imported by fixtures/…/runmain.mjs)
23+
* 3. doesnt-matter.mjs (first import.meta.resolve call)
24+
* 4. fixtures/…/runmain.mjs (entry point)
25+
* 5. doesnt-matter.mjs (second import.meta.resolve call)
2526
*/
26-
assert.strictEqual(resolveHookRunCount, 2);
27+
assert.strictEqual(stdout.match(/resolve passthru/g)?.length, 5);
2728
assert.strictEqual(code, 0);
2829
});
2930
});

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.