Skip to content

test: cover worker throwing primitive values#64365

Open
dobbydobap wants to merge 1 commit into
nodejs:mainfrom
dobbydobap:test-worker-error-primitive
Open

test: cover worker throwing primitive values#64365
dobbydobap wants to merge 1 commit into
nodejs:mainfrom
dobbydobap:test-worker-error-primitive

Conversation

@dobbydobap

@dobbydobap dobbydobap commented Jul 8, 2026

Copy link
Copy Markdown

What this does: Adds a regression test asserting that when a worker throws a non-Error value (string, number, bigint, boolean, null, undefined), the parent's 'error' handler receives that value directly rather than a wrapped ERR_UNHANDLED_ERROR.

The behavior is already correct on main; this adds the missing coverage so #35506 can't regress.

How I tested: python tools/test.py test/parallel/test-worker-error-primitive.js → passes; also ran the file directly.

Fixes: #35506

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jul 8, 2026
Comment thread test/parallel/test-worker-error-primitive.js
A worker that throws a non-Error value (string, number, bigint,
boolean, null, undefined) surfaces that value on the parent's
'error' handler. This was reported as a wrapped ERR_UNHANDLED_ERROR
and is now correct, but had no regression coverage.

Refs: nodejs#35506
Signed-off-by: dobbydobap <varshitha.kolupuri@gmail.com>
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jul 9, 2026
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.25%. Comparing base (8e1ab55) to head (dcd552d).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64365      +/-   ##
==========================================
+ Coverage   90.23%   90.25%   +0.01%     
==========================================
  Files         741      741              
  Lines      240979   241194     +215     
  Branches    45395    45432      +37     
==========================================
+ Hits       217450   217684     +234     
+ Misses      15112    15074      -38     
- Partials     8417     8436      +19     

see 56 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.

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 9, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[worker_threads]: Main thread receives Error object when the worker throws a primitive value

4 participants