Skip to content

Commit 1842020

Browse files
author
Dummy
committed
added doc.
1 parent 24532a6 commit 1842020

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ interface Calculator {
1616
add(a: number, b: number): number;
1717
subtract(a: number, b: number): number;
1818
divide(a: number, b: number): number;
19+
20+
isEnabled: boolean;
1921
}
2022

2123
//Create:
@@ -49,8 +51,20 @@ console.log(calculator.add(1, 2)); //prints 9
4951
console.log(calculator.add(1, 2)); //prints undefined
5052
```
5153

54+
## Verifying calls
55+
```typescript
56+
calculator.enabled = true;
57+
var foo = calculator.add(1, 2);
58+
59+
//verify call to add(1, 2)
60+
calculator.received().add(1, 2);
61+
62+
//verify property set to "true"
63+
calculator.received().enabled = true;
64+
```
65+
5266
## Argument matchers
53-
There are several ways of matching arguments. The examples below also applies to properties and fields.
67+
There are several ways of matching arguments. The examples below also applies to properties and fields - both when setting up calls and verifying them.
5468

5569
### Matching specific arguments
5670
```typescript

0 commit comments

Comments
 (0)