Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Async exceptions in beforeMount not caught in unit tests #1503

Copy link
Copy link
Closed
@Yodablues

Description

@Yodablues
Issue body actions

Version

1.0.0-beta.33

Reproduction link

https://codesandbox.io/s/white-dream-1vmod

Steps to reproduce

Create a new component that throws an exception in an async beforeMount. In my Test.vue component, I create a simple component that waits 500ms and then throws an exception.

Create a test that asserts exceptions are being thrown when mount/shallowMount are called.
In my test, I expect.assertions(1) to let Jest know to expect a single exception. Then I wrapped shallowMount in a try/catch and call done() in finally.

What is expected?

Exceptions would be caught in the test suite.

What is actually happening?

Exceptions are not caught and the test fails.


In non-async beforeMount, exceptions are caught, however they still get logged to the console.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.