Skip to content

Support hoisting when import from @jest/globals #1593

@ahnpnl

Description

@ahnpnl

🚀 Feature Proposal

Jest has a new package @jest/globals in v25.5.0 which Jest's globals can be explicitly imported.

The introduction of this new package also led to the change of hoisting in babel-jest plugin. We also need to do the similar thing, referencing Jest PR jestjs/jest#9806

Motivation

To make hoisting behavior not different between babel-jest and ts-jest so users won't encounter any issues.

Example

See example in jestjs/jest#9806

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions