Skip to content

Commit 10ec212

Browse files
committed
Main features anchors to examples in readme
1 parent 7c4cd1f commit 10ec212

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ Mocking library for TypeScript inspired by http://mockito.org/
1010

1111
* Strongly typed
1212
* IDE autocomplete
13-
* Mock creation (`mock`) (also abstract classes)
14-
* Spying on real objects (`spy`)
13+
* Mock creation (`mock`) (also abstract classes) [#example](#basics)
14+
* Spying on real objects (`spy`) [#example](#spying-on-real-objects)
1515
* Changing mock behavior (`when`) via:
16-
* `thenReturn` - return value
17-
* `thenThrow` - throw an error
18-
* `thenCall` - call custom method
19-
* `thenResolve` - resolve promise
20-
* `thenReject` - rejects promise
16+
* `thenReturn` - return value [#example](#stubbing-method-calls)
17+
* `thenThrow` - throw an error [#example](#throwing-errors)
18+
* `thenCall` - call custom method [#example](#custom-function)
19+
* `thenResolve` - resolve promise [example](#resolving--rejecting-promises)
20+
* `thenReject` - rejects promise [example](#resolving--rejecting-promises)
2121
* Checking if methods were called with given arguments (`verify`)
2222
* `anything`, `notNull`, `anyString`, `anyOfClass` etc. - for more flexible comparision
23-
* `once`, `twice`, `times`, `atLeast` etc. - allows call count verification
24-
* `calledBefore`, `calledAfter` - allows call order verification
25-
* Resetting mock (`reset`, `resetCalls`)
26-
* Capturing arguments passed to method (`capture`)
27-
* Recording multiple behaviors
28-
* Readable error messages (ex. 'Expected "convertNumberToString(strictEqual(3))" to be called 2 time(s). But has been called 1 time(s).')
23+
* `once`, `twice`, `times`, `atLeast` etc. - allows call count verification [#example](#call-count-verification)
24+
* `calledBefore`, `calledAfter` - allows call order verification [#example](#call-order-verification)
25+
* Resetting mock (`reset`, `resetCalls`) [#example](#resetting-mock-calls), [#example](#resetting-mock)
26+
* Capturing arguments passed to method (`capture`) [#example](#capturing-method-arguments)
27+
* Recording multiple behaviors [#example](#recording-multiple-behaviors)
28+
* Readable error messages (ex. `'Expected "convertNumberToString(strictEqual(3))" to be called 2 time(s). But has been called 1 time(s).'`)
2929

3030
## Installation
3131

0 commit comments

Comments
 (0)