Skip to content

Upgrade to Jest 26 - #8955

Merged
ianschmitz merged 9 commits into
react:masterfrom
ianschmitz:jest-26
Jun 1, 2020
Merged

ianschmitz merged 9 commits into
react:masterfrom
ianschmitz:jest-26

Conversation

@ianschmitz

@ianschmitz ianschmitz commented May 4, 2020 •

Copy link
Copy Markdown
Contributor

Closes #8954.

We can ship the TypeScript template referencing @types/jest@25 until the 26 version drops. There should only be minor differences that we can call out in our release notes. From Simen:

main changes from 25 to 26 would be removal of require.requireActual, adding jest.useFakeTimers('modern') and adding jest.createMockFromModule()

Still todo:

cc @SimenB.

@ianschmitz ianschmitz added this to the 4.0 milestone May 4, 2020
@ianschmitz ianschmitz changed the title Update Jest to 26 Upgrade to Jest 26 May 4, 2020
@ianschmitz

ghost commented May 6, 2020 •

Copy link
Copy Markdown
Contributor Author

Running into issues on Node 10.20.1 when running Jest.

While running in debug it's choking here: https://github.com/jsdom/jsdom/blob/8921128ee1efe6737e3ea200959eb01fe75ff3aa/lib/jsdom/browser/Window.js#L51, as jsGlobals includes globalThis which causes error:

    ReferenceError: globalThis is not defined

      at evalmachine.<anonymous>:1:1
      at setupWindow (node_modules/jsdom/lib/jsdom/browser/Window.js:51:55)
      at new Window (node_modules/jsdom/lib/jsdom/browser/Window.js:107:3)
      at exports.createWindow (node_modules/jsdom/lib/jsdom/browser/Window.js:38:10)
      at new JSDOM (node_modules/jsdom/lib/api.js:36:20)

Looks to be the same issue somebody else mentioned in the jsdom issues: jsdom/jsdom#2795 (comment)

I've created an issue in the jsdom repo to track this.

@ianschmitz ianschmitz closed this May 29, 2020
@ianschmitz ianschmitz reopened this May 29, 2020
@SimenB

ghost commented May 29, 2020

Copy link
Copy Markdown
Contributor

🎉

@ianschmitz
ianschmitz marked this pull request as ready for review May 29, 2020 20:35

ghost left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works - and I see the CI passes - then I think it's a good temporary fix!

@ianschmitz
ianschmitz merged commit c87ab79 into react:master Jun 1, 2020
@ianschmitz
ianschmitz deleted the jest-26 branch June 20, 2020 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jest 26

4 participants