Skip to content

fix: align restoreObject docs test with idempotent behavior#2745

Merged
hexeberlin merged 1 commit into
mainfrom
fix/restoreObject-docs-test
Jul 20, 2026
Merged

fix: align restoreObject docs test with idempotent behavior#2745
hexeberlin merged 1 commit into
mainfrom
fix/restoreObject-docs-test

Conversation

@hexeberlin

Copy link
Copy Markdown
Contributor

Description

PR #2737 intentionally made sinon.restoreObject idempotent — calling it on an object with no restorable methods now silently returns the object instead of throwing. The docs page and its corresponding test still documented the old throwing behavior, causing the Docs CI workflow to fail.

Changes

  • docs/tests/docs/utils-3.test.js: Changed from t.throws to t.doesNotThrow with updated test description
  • docs/concepts/utils.md: Updated description from "Throws an error" to "Does nothing" if the object contains no restorable methods

Related

restoreObject was made idempotent in #2737 — it no longer throws
for objects with no restorable methods. Updates the docs page
and its corresponding test to reflect this.
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.44%. Comparing base (a68dac1) to head (3d18256).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2745   +/-   ##
=======================================
  Coverage   97.44%   97.44%           
=======================================
  Files          39       39           
  Lines        1838     1838           
=======================================
  Hits         1791     1791           
  Misses         47       47           
Flag Coverage Δ
unit 97.44% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@hexeberlin
hexeberlin merged commit 40c4caa into main Jul 20, 2026
20 checks passed
@hexeberlin
hexeberlin deleted the fix/restoreObject-docs-test branch July 20, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants