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_runner: remove stray quotes from module mock error by farisbasha · Pull Request #67569 · nodejs/node

Conversation

@farisbasha

@farisbasha farisbasha commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

The generated CommonJS mock source threw
new Error('${JSONStringify(kBadExportsMessage)}'). JSONStringify already returns a quoted string literal, so the extra single quotes made the double quotes part of the message:
"Cannot create mock because ...". Pass the JSON literal directly and check the start of the message in the test.

Disclosure: I used an AI assistant to help find this and draft the change and this description.

Sorry, something went wrong.

Uh oh!

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

All reactions
@farisbasha
test_runner: remove stray quotes from module mock error
96f36fe
The generated CommonJS mock source threw
new Error('${JSONStringify(kBadExportsMessage)}'). JSONStringify
already returns a quoted string literal, so the extra single quotes
made the double quotes part of the message:
"Cannot create mock because ...". Pass the JSON literal directly and
check the start of the message in the test.

Signed-off-by: farisbasha <[email protected]>
@nodejs-github-bot

nodejs-github-bot commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner
All reactions

Sorry, something went wrong.

Uh oh!

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

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Nov 18, 2026
@github-actions github-actions Bot added the agentscan:automated-account label Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

  • the guide for first-time contributors
  • the contribution and automation policies
  • the pull request guide
  • the AI use policy
  • the Code of Conduct

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

Caution

AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context.

All reactions

Sorry, something went wrong.

Uh oh!

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

@MikeMcC399

MikeMcC399 commented Nov 18, 2026

Copy link
Copy Markdown
Member

The recommendations in:

  • Guides and FAQs for first-time contributors

advise you should tackle only one issue at a time and that you should not open any new PRs until your first PR has been approved.

You already have another unapproved PR #67555 open at this time.

Until the first PR has been approved and has landed in the main branch, GitHub classifies you as "first-time contributor". Each PR commit you push needs to be individually approved by team members to run in GitHub Actions CI. This causes delays for you as a contributor, and it adds to the work load for the team.

Waiting until the first PR has landed ensures that you as a contributor have experienced the complete process from PR submission to successful landing. After this has been completed, any new PRs or new commits to an existing PR are treated to rules for regular Contributors. GitHub Actions CI workflows are then run automatically without intervention by a team member.

All reactions

Sorry, something went wrong.

Uh oh!

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

@farisbasha

farisbasha commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the guidance and for pointing me to the first-time contributor docs. Understood - I'll focus on getting #67555 approved and landed first, and won't open any new PRs here until then.

All reactions

Sorry, something went wrong.

Uh oh!

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

@codecov

codecov Bot commented Nov 18, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.71%. Comparing base (9305353) to head (f7a0dac).
⚠️ Report is 55 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #67569    +/-   ##
========================================
  Coverage   90.71%   90.71%            
========================================
  Files         801      801            
  Lines      280740   280945   +205     
  Branches    54171    54245    +74     
========================================
+ Hits       254661   254871   +210     
+ Misses      16258    16253     -5     
  Partials     9821     9821            
Files with missing lines Coverage Δ
lib/internal/test_runner/mock/loader.js 99.35% <100.00%> (+<0.01%) ⬆️

... and 58 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

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

@farisbasha

farisbasha commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review and the clear explanation of the fix!

All reactions

Sorry, something went wrong.

Uh oh!

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

jasnell
jasnell approved these changes Nov 18, 2026
View reviewed changes
Renegade334
Renegade334 approved these changes Nov 18, 2026
View reviewed changes

@Renegade334 Renegade334 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.

This is fine, although since it's a constant, it would make more sense to wrap JSONStringify around the original definition of kBadExportsMessage, rather than re-stringifying it on every error with the same result.

Sorry, something went wrong.

Uh oh!

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

All reactions
@farisbasha
test_runner: stringify the bad exports message once
f7a0dac
Signed-off-by: farisbasha <[email protected]>
@farisbasha

farisbasha commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @Renegade334, good point. I couldn't wrap the definition itself because kBadExportsMessage is also exported and thrown directly in mock.js (throw new Error(kBadExportsMessage)), so I added a kBadExportsMessageSource constant that stringifies it once at load time and used that in the generated source. Thanks @jasnell for the review too.

All reactions

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@Renegade334 Renegade334 Renegade334 approved these changes

At least 1 approving review is required to merge this pull request.

Uh oh!

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

Assignees

No one assigned

Labels

agentscan:automated-account needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

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

@farisbasha @nodejs-github-bot @MikeMcC399 @jasnell @Renegade334
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 01402775 — 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.