Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/concepts/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
8 changes: 3 additions & 5 deletions docs/tests/docs/utils-3.test.js
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
Loading