Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(transformer): support hoisting when using @jest/globals #1937

Merged
merged 1 commit into from
Sep 10, 2020
Merged

feat(transformer): support hoisting when using @jest/globals #1937

merged 1 commit into from
Sep 10, 2020

Conversation

ahnpnl
Copy link
Collaborator

@ahnpnl ahnpnl commented Sep 10, 2020

Summary

Support hoisting when using @jest/globals, applying to:

  • named import, e.g. import { jest } from '@jest/globals'

  • aliased named import, e.g. import {jest as aliasedJest} from '@jest/globals'

  • namespace import, e.g import * as JestGlobals from '@jest/globals'

Closes #1593

Test plan

Green CI

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

N.A.

Support hoisting when using `@jest/globals`, applying to:

- named import, e.g. `import { jest } from '@jest/globals'`

- aliased named import, e.g. `import {jest as aliasedJest} from '@jest/globals'`

- namespace import, e.g `import * as JestGlobals from '@jest/globals'`

Closes #1593
@ahnpnl ahnpnl merged commit 0e5be15 into kulshekhar:master Sep 10, 2020
@ahnpnl ahnpnl deleted the fix-hoisting-2 branch September 10, 2020 09:31
ahnpnl added a commit that referenced this pull request Sep 14, 2020
…1955)

In #1937, we added support for `@jest/globals`. However, the logic to detect jest import name bindings wasn't correct. It failed with the case `import {test,jest} from '@jest/globals'`. This PR is to fix that issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support hoisting when import from @jest/globals
2 participants