Skip to content

Commit

Permalink
docs: Remove threw(obj) from docs (#2513)
Browse files Browse the repository at this point in the history
Since the introduction of threw in
0feec9f, no one have reported that
`threw(obj)` doesn't work as the documentation states.

```js
const sinon = require("sinon");
const o = { pie: "apple" };
const f = sinon.fake.throws(o);

f();
// this is supposed to return true
f.threw(o);
// => false
```

Since it has been 12+ years without an error report, it's safe to assume
that no one uses the `threw` method in this way. Let's remove it from
the documentation.
  • Loading branch information
mroderick committed May 23, 2023
1 parent 7e13966 commit 05f05ac
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions docs/release-source/release/spies.md
Expand Up @@ -282,10 +282,6 @@ Returns `true` if spy threw an exception at least once.

Returns `true` if spy threw an exception of the provided type at least once.

#### `spy.threw(obj);`

Returns `true` if spy threw the provided exception object at least once.

#### `spy.alwaysThrew();`

Returns `true` if spy always threw an exception.
Expand All @@ -294,10 +290,6 @@ Returns `true` if spy always threw an exception.

Returns `true` if spy always threw an exception of the provided type.

#### `spy.alwaysThrew(obj);`

Returns `true` if spy always threw the provided exception object.

#### `spy.returned(obj);`

Returns `true` if spy returned the provided value at least once.
Expand Down

0 comments on commit 05f05ac

Please sign in to comment.