Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

CustomEvent thrown TypeError is not an instance of TypeError #160

Closed as not planned
@CMCDragonkai

Description

@CMCDragonkai

I noticed this while using Node 20.x and using the new CustomEvent global.

Inside nodejs this answers true:

try { new CustomEvent('abc', 'abc') } catch (e) { console.log(e instanceof TypeError); }

However when running inside jest it ends up producing false instead.

Initial research points to transpilation being where the source of this problem is likely. However it could also be a jest upstream situation.

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