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 — esm: refactor mocking test by GeoffreyBooth · Pull Request #49465 · nodejs/node

Conversation

@GeoffreyBooth

@GeoffreyBooth GeoffreyBooth commented Sep 3, 2023

Copy link
Copy Markdown
Member

This PR refactors test/es-module/test-esm-loader-mock.mjs to use the new register and initialize APIs instead of globalPreload and setImportMetaCallback. I tried to preserve as much of the previous test as possible; all of the assertions from the earlier version are unchanged. This test passes both here, on main, and within #49144.

The largest addition to test-esm-loader-mock.mjs was code that just moved there from within the insideAppContext function in mock-loader.mjs.

@nodejs/loaders

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JakobJingleheimer and bricss reacted with hooray emoji
All reactions
  • 🎉 2 reactions
@GeoffreyBooth GeoffreyBooth added test Issues and PRs related to Node.js core tests and test infrastructure. esm Issues and PRs related to the ECMAScript Modules implementation. loaders Issues and PRs related to ES module loaders. labels Sep 3, 2023
@GeoffreyBooth
GeoffreyBooth requested review from JakobJingleheimer, aduh95 and bmeck September 3, 2023 00:51
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Sep 3, 2023
@nodejs-github-bot

nodejs-github-bot commented Sep 3, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/53699/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth GeoffreyBooth mentioned this pull request Sep 3, 2023
esm: remove globalPreload hook (superseded by initialize) #49144
Merged
@GeoffreyBooth GeoffreyBooth removed the needs-ci PRs that need a full CI run. label Sep 3, 2023
JakobJingleheimer
JakobJingleheimer approved these changes Sep 3, 2023
View reviewed changes

@JakobJingleheimer JakobJingleheimer left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌 wow! we should use this before & after as a poster-child for register & initialize

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
aduh95
aduh95 reviewed Sep 3, 2023
View reviewed changes
Comment thread test/es-module/test-esm-loader-mock.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/es-module/test-esm-loader-mock.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/es-module/test-esm-loader-mock.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/es-module/test-esm-loader-mock.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/fixtures/es-module-loaders/mock-loader.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/fixtures/es-module-loaders/mock-loader.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/es-module/test-esm-loader-mock.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 aduh95 added the needs-ci PRs that need a full CI run. label Sep 3, 2023
aduh95
aduh95 reviewed Sep 3, 2023
View reviewed changes
Comment thread test/es-module/test-esm-loader-mock.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 reviewed Sep 3, 2023
View reviewed changes
Comment thread test/fixtures/es-module-loaders/mock-loader.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 reviewed Sep 3, 2023
View reviewed changes
Comment thread test/fixtures/es-module-loaders/mock-loader.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 reviewed Sep 3, 2023
View reviewed changes
Comment thread test/es-module/test-esm-loader-mock.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

GeoffreyBooth added 3 commits September 3, 2023 18:50
@GeoffreyBooth @aduh95
esm: refactor mocking test
3e846c4
@GeoffreyBooth @aduh95
Move setup code into fixture; avoid global; add JSON.stringify, __pro…
a12d520
…to__
@GeoffreyBooth @aduh95
Review notes
844fe45
aduh95
aduh95 reviewed Sep 3, 2023
View reviewed changes
Comment thread test/es-module/test-esm-loader-mock.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 reviewed Sep 3, 2023
View reviewed changes
Comment thread test/fixtures/es-module-loaders/mock.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@aduh95
do not mutate import.meta, trailing commas, add doDrainPort back
d1bedb7
@aduh95
aduh95 force-pushed the refactor-mocking-test branch from bcb1837 to d1bedb7 Compare September 3, 2023 18:48
GeoffreyBooth
GeoffreyBooth commented Sep 3, 2023
View reviewed changes
Comment thread test/fixtures/es-module-loaders/mock-loader.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@aduh95
Update test/fixtures/es-module-loaders/mock-loader.mjs
34cc279
aduh95
aduh95 reviewed Sep 3, 2023
View reviewed changes
Comment thread test/fixtures/es-module-loaders/mock-loader.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@aduh95
Update test/fixtures/es-module-loaders/mock-loader.mjs
7a58719
aduh95
aduh95 approved these changes Sep 4, 2023
View reviewed changes
@GeoffreyBooth GeoffreyBooth removed the needs-ci PRs that need a full CI run. label Sep 4, 2023
@GeoffreyBooth GeoffreyBooth added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 4, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 4, 2023
@nodejs-github-bot

nodejs-github-bot commented Sep 4, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/53719/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 aduh95 added the needs-ci PRs that need a full CI run. label Sep 4, 2023
@GeoffreyBooth GeoffreyBooth mentioned this pull request Sep 4, 2023
esm: refactor globalPreload tests #49493
Closed
@nodejs-github-bot

nodejs-github-bot commented Sep 4, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/53731/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Sep 5, 2023
CI Reliability 2023-09-05 nodejs/reliability#656
Open
19 tasks
@nodejs-github-bot

nodejs-github-bot commented Sep 5, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/53732/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Sep 5, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/53735/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth GeoffreyBooth added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. labels Sep 5, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 5, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 6a5394e into nodejs:main Sep 5, 2023
@nodejs-github-bot

nodejs-github-bot commented Sep 5, 2023

Copy link
Copy Markdown
Collaborator

Landed in 6a5394e

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth
GeoffreyBooth deleted the refactor-mocking-test branch September 5, 2023 01:14
This was referenced Sep 6, 2023
CI Reliability 2023-09-06 nodejs/reliability#657
Open
CI Reliability 2023-09-07 nodejs/reliability#658
Open
CI Reliability 2023-09-08 nodejs/reliability#659
Open
CI Reliability 2023-09-09 nodejs/reliability#660
Open
ruyadorno pushed a commit that referenced this pull request Sep 28, 2023
@GeoffreyBooth @ruyadorno
esm: refactor mocking test
f34bd15
PR-URL: #49465
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
This was referenced Sep 28, 2023
v20.7.1 proposal #49917
Closed
v20.8.0 proposal #49932
Merged
targos pushed a commit to targos/node that referenced this pull request Nov 11, 2023
@GeoffreyBooth @targos
esm: refactor mocking test
3c9111e
PR-URL: nodejs#49465
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
@targos targos mentioned this pull request Nov 11, 2023
[v18.x] Backport most ESM and customization hook changes #50669
Closed
@targos targos added the backported-to-v18.x label Nov 23, 2023
targos pushed a commit that referenced this pull request Nov 23, 2023
@GeoffreyBooth @targos
esm: refactor mocking test
d1f5514
PR-URL: #49465
Backport-PR-URL: #50669
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
@targos targos mentioned this pull request Nov 28, 2023
v18.19.0 release proposal #50953
Merged
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
@sercher
esm: refactor mocking test
cda5c71
PR-URL: nodejs/node#49465
Backport-PR-URL: nodejs/node#50669
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
@sercher
esm: refactor mocking test
6a0900a
PR-URL: nodejs/node#49465
Backport-PR-URL: nodejs/node#50669
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JakobJingleheimer JakobJingleheimer JakobJingleheimer approved these changes
@aduh95 aduh95 aduh95 approved these changes
@bmeck bmeck Awaiting requested review from bmeck

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. esm Issues and PRs related to the ECMAScript Modules implementation. loaders Issues and PRs related to ES module loaders. needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@GeoffreyBooth @nodejs-github-bot @JakobJingleheimer @aduh95 @targos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.