Skip to content

t.notThrows(promise) should return an "empty" promise #1227

@novemberborn

Description

@novemberborn

This is as expected:

const value = Symbol()
t.notThrows(() => value) === undefined

However:

const value = Symbol()
(await t.notThrows(Promise.resolve(value))) === value

t.notThrows(promise) should return a promise, but for an undefined value.

The offending line is at

return fn
.

The Flow and TypeScript definitions should be updated too:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcurrent functionality does not work as desired

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions