Skip to content

Remove "assertThrowsAsync" in Deno v1.17 #1562

Closed
@bartlomieju

Description

@bartlomieju

The "assertThrowsAsync" has been deprecated since August (over 3 months ago) and I think it's high time we remove it completely.

A good target would be Deno 1.17 (so probably 0.117.0 or 0.118.0 for deno_std).

Activity

added this to the 1.17 milestone on Nov 12, 2021
kitsonk

kitsonk commented on Nov 16, 2021

@kitsonk
Contributor

The way it is being exported means that it does actually reflect in any IDE intellisense that it has been deprecated.

I was curious, because I was using it and wasn't seeing any warnings and I went and looked. The JSDoc block doesn't work that way... We would need to do something like:

/**
 * Executes a function which returns a promise, expecting it to throw or reject.
 * If it does not, then it throws.  An error class and a string that should be
 * included in the error message can also be asserted.
 *
 * @deprecated use `assertRejects` instead.
 */
export const assertThrowsAsync = assertRejects;

Also, its deprecation isn't reflected in the generated docs, so I don't think we should get rid of it until we actually properly inform people it is deprecated and what it is replaced with.

kt3k

kt3k commented on Nov 16, 2021

@kt3k
Member

Oh, I didn't realize this. Thank you for reporting this. I created a PR for the fix #1593

kitsonk

kitsonk commented on Nov 16, 2021

@kitsonk
Contributor

ooops, didn't mean to close it... sorry.

bartlomieju

bartlomieju commented on Nov 16, 2021

@bartlomieju
MemberAuthor

Still I think we should remove it completely in Deno 1.17. #1583 was done abruptly as well and it seems @ry has no problem with removing APIs as std is still considered unstable.

added a commit that references this issue on Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    suggestiona suggestion yet to be agreed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Remove "assertThrowsAsync" in Deno v1.17 · Issue #1562 · denoland/std