diff --git a/docs/concepts/utils.md b/docs/concepts/utils.md index 40ab44560..6a5d5ecfd 100644 --- a/docs/concepts/utils.md +++ b/docs/concepts/utils.md @@ -23,8 +23,8 @@ Restores all methods of an object and returns the restored object. <<< ../.vitepress/tests/docs/utils-2.test.js -Throws an error if the object contains no restorable methods (spies, stubs, etc). +Does nothing if the object contains no restorable methods (spies, stubs, etc). <<< ../.vitepress/tests/docs/utils-3.test.js -Throws an error if the object contains no restorable methods (spies, stubs, etc). +Does nothing if the object contains no restorable methods (spies, stubs, etc). diff --git a/docs/tests/docs/utils-3.test.js b/docs/tests/docs/utils-3.test.js index 5fbb809da..c523df6b8 100644 --- a/docs/tests/docs/utils-3.test.js +++ b/docs/tests/docs/utils-3.test.js @@ -1,14 +1,12 @@ import t from "tap"; import sinon from "sinon"; -t.test("restoreObject throws when object has no restorable methods", (t) => { +t.test("restoreObject is a no-op when object has no restorable methods", (t) => { const emptyObj = {}; - // Verify it throws an error - t.throws( + t.doesNotThrow( () => sinon.restoreObject(emptyObj), - /no methods/i, - "should throw error about no methods to restore" + "should be a no-op when object has no restorable methods" ); t.end();