Skip to content

Commit e684c1e

Browse files
cleancodethomasmantoni
authored andcommitted
Add example where withArgs of a stub is used in an assertion
1 parent c1e07a3 commit e684c1e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

docs/release-source/release/examples/stubs-2-different-args.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ describe("stubbed callback", function() {
1111

1212
assert.isUndefined(callback()); // No return value, no exception
1313
assert.equals(callback(42), 1); // Returns 1
14+
assert.equals(callback.withArgs(42).callCount, 1);// Use withArgs in assertion
1415
assert.exception(() => {
1516
callback(1);
1617
}); // Throws Error("name")

0 commit comments

Comments
 (0)