Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Remove threw(obj) from docs #2513

Merged
merged 1 commit into from
May 23, 2023
Merged

docs: Remove threw(obj) from docs #2513

merged 1 commit into from
May 23, 2023

Conversation

mroderick
Copy link
Member

Since the introduction of threw in 0feec9f, no one have reported that threw(obj) doesn't work as the documentation states.

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.

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.
@mroderick mroderick requested a review from fatso83 May 15, 2023 15:55
@mroderick
Copy link
Member Author

I'm not sure if this should have a version bump at all

@codecov
Copy link

codecov bot commented May 15, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (b2a4df5) 95.99% compared to head (5f7a468) 95.99%.

❗ Current head 5f7a468 differs from pull request most recent head 832439d. Consider uploading reports for the commit 832439d to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2513   +/-   ##
=======================================
  Coverage   95.99%   95.99%           
=======================================
  Files          40       40           
  Lines        1899     1899           
=======================================
  Hits         1823     1823           
  Misses         76       76           
Flag Coverage Δ
unit 95.99% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fatso83
Copy link
Contributor

fatso83 commented May 16, 2023

Why not remove the threw prop at the same time and clean it up? Or fix it? Now it is just left as historic scraps

@mroderick
Copy link
Member Author

Why not remove the threw prop at the same time and clean it up? Or fix it? Now it is just left as historic scraps

Using no argument spy.threw() or with a named error type spy.threw("TypeError"), threw works as documented.

@fatso83 fatso83 merged commit 05f05ac into main May 23, 2023
11 checks passed
@fatso83 fatso83 deleted the remove-threw-obj-from-docs branch May 23, 2023 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants