Skip to content

When using an async function in t.throws(), receive errors: "Function returned: Promise {}" and "Unhandled rejection" #1931

Closed
@Lukenickerson

Description

@Lukenickerson

Description

In 1.0.0-beta.8 (with no special configuration or command line arguments) I'm seeing an error with essentially the same function that was posted in #1371.

Test Source

import test from 'ava';

test('test', async (t) => {
  await t.throws(async () => {
    throw new Error();
  });
});

Error Message & Stack Trace

Message returned from running the test says something like:

1 test failed
1 unhandled rejection

Line: await t.throws(async () => {
Function returned: Promise {}

Line: throw new Error();
Unhandled rejection in [test filename]

Environment

Node.js v10.9.0
darwin 17.6.0
AVA 1.0.0-beta.8
npm 6.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions