Skip to content

Commit a02a00e

Browse files
committed
Merge pull request #83 from verdammelt/patch-1
doc: thenDo and thenThrow are no longer unimplemented.
2 parents bcb1df4 + eb9e859 commit a02a00e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/5-stubbing-results.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ As JavaScript APIs go, this should strike readers as unusual, but it's an intent
2222

2323
> If the above is still bothering you, note that the implementation of testdouble.js doesn't care what is "passed" into `td.when()`'s first argument position. In fact, what the library will actually do is simply pop the most recent call to _any test double_ off its global call stack whenever `when()` is invoked and presume that it was a "rehearsal" invocation for the next stubbing.
2424
25-
The `when()` function returns an object containing the function `thenReturn`, which is used to specify the value the test double should return if it's invoked as specified in the `when()` call. For now, only `thenReturn` is supported as a response type. For whatever reason, we haven't found an urgent need to implement two other typical responses, `thenDo` (to invoke a function that has some side effect, [#8](https://github.com/testdouble/testdouble.js/issues/8)) and `thenThrow` (to throw some error, [#7](https://github.com/testdouble/testdouble.js/issues/7)), but we'd gladly accept pull requests for either.
25+
The `when()` function returns an object containing the function `thenReturn`, which is used to specify the value the test double should return if it's invoked as specified in the `when()` call. There are also a `thenDo` and `thenThrow` response type which are described below.
2626

2727
## Simple, precise argument stubbing
2828

0 commit comments

Comments
 (0)