Skip to content

Comments

fix: update tests for sinon v21 error stringification#5731

Merged
mark-wiemer merged 4 commits intorenovate/sinon-21.xfrom
copilot/sub-pr-5729
Feb 19, 2026
Merged

fix: update tests for sinon v21 error stringification#5731
mark-wiemer merged 4 commits intorenovate/sinon-21.xfrom
copilot/sub-pr-5729

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

Sinon v21 changed how .throws() stringifies errors. Previously stub.throws("message") produced errors that stringified to just "message". Now they stringify as "Error: Sinon-provided message".

Changes

  • test/node-unit/cli/config.spec.js: Create Error with custom toString() to match expected format
  • test/node-unit/cli/options.spec.js: Create Error with custom toString() to match expected format
  • mocha.mjs: Remove unused eslint-disable directive exposed by updated dependencies

Example

// Before: worked with sinon v9
sinon.stub(parsers, "yaml").throws("goo.yaml is unparsable");

// After: works with sinon v21
const error = new Error("goo.yaml is unparsable");
error.toString = function() { return this.message; };
sinon.stub(parsers, "yaml").throws(error);

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 16, 2026

CLA Not Signed

Copilot AI and others added 2 commits February 16, 2026 23:16
Fixed two test failures caused by changes in sinon v21's error handling.
In sinon v21, errors thrown by stubs now have different stringification
behavior. Updated tests to create Error objects with custom toString()
methods to match expected error message format.

Co-authored-by: mark-wiemer <7833360+mark-wiemer@users.noreply.github.com>
Co-authored-by: mark-wiemer <7833360+mark-wiemer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8645 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-29040090 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14458703852493126949,9071328544852963738,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-29040090 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=29040090 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 mjs ure.js (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8818 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-3368419 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,10083144069545975492,9646630104553434820,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8645 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-29040090 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14458703852493126949,9071328544852963738,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-29040090 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=29040090 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 mjs ure.js (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8818 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-3368419 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,10083144069545975492,9646630104553434820,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • clientservices.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8645 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-29040090 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14458703852493126949,9071328544852963738,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-29040090 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=29040090 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 mjs ure.js (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8818 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-3368419 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,10083144069545975492,9646630104553434820,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8645 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-29040090 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14458703852493126949,9071328544852963738,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-29040090 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=29040090 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 mjs ure.js (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8818 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-3368419 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,10083144069545975492,9646630104553434820,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • safebrowsingohttpgateway.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8645 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-29040090 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14458703852493126949,9071328544852963738,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-29040090 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=29040090 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 mjs ure.js (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8818 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-3368419 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,10083144069545975492,9646630104553434820,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8645 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-29040090 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14458703852493126949,9071328544852963738,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-29040090 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=29040090 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 mjs ure.js (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=8818 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-3368419 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,10083144069545975492,9646630104553434820,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update dependency sinon to version 21.0.1 fix: update tests for sinon v21 error stringification Feb 16, 2026
Copilot AI requested a review from mark-wiemer February 16, 2026 23:20
@mark-wiemer
Copy link
Member

Manually triggered test run: https://github.com/mochajs/mocha/actions/runs/22081335508

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.85%. Comparing base (87224d8) to head (a246c2e).
⚠️ Report is 7 commits behind head on renovate/sinon-21.x.

Additional details and impacted files
@@                 Coverage Diff                  @@
##           renovate/sinon-21.x    #5731   +/-   ##
====================================================
  Coverage                88.85%   88.85%           
====================================================
  Files                       66       66           
  Lines                     4774     4774           
  Branches                   976      976           
====================================================
  Hits                      4242     4242           
  Misses                     532      532           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@renovate renovate bot force-pushed the renovate/sinon-21.x branch from 6feb9ef to 0f17221 Compare February 17, 2026 18:54
@mark-wiemer
Copy link
Member

Lint failed because Copilot wrongly removed a directive: n/no-missing-import, everything else passed, merging this with its parent branch (not with main branch yet)

@mark-wiemer mark-wiemer marked this pull request as ready for review February 19, 2026 02:07
@mark-wiemer mark-wiemer merged commit 93e9635 into renovate/sinon-21.x Feb 19, 2026
80 of 82 checks passed
@mark-wiemer mark-wiemer deleted the copilot/sub-pr-5729 branch February 19, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants