Skip to content

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

Merged
ahnpnl merged 1 commit intokulshekhar:masterfrom
ahnpnl:fix-hoisting-2
Sep 10, 2020
Merged

feat(transformer): support hoisting when using @jest/globals#1937
ahnpnl merged 1 commit intokulshekhar:masterfrom
ahnpnl:fix-hoisting-2

Conversation

@ahnpnl
Copy link
Copy Markdown
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.

@ahnpnl ahnpnl requested a review from kulshekhar as a code owner September 10, 2020 08:02
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