Skip to content

toMatchSnapshot does not throw an exception on failure #9107

Closed as not planned
@manu-st

Description

@manu-st

🐛 Bug Report

Whenever I use toMatchSnapshot () as in expect (val).toMatchSnapshot () and that it fails, no exception is being thrown as this is done for other matchers. Not sure if it matters, but I always use async calls.

To Reproduce

test ("Async snapshot", async () =>
{
   expect ("Some value not matching previous snapshot").toMatchSnapshot ();
}

Expected behavior

An exception is thrown so I can catch it like this is done for other matchers.

envinfo

Using jest v24.7.1 with ts-jest v24.1.0.

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