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

Update jest to v26 along with packages related to it #19920

Closed
wants to merge 6 commits into from
Closed

Update jest to v26 along with packages related to it #19920

wants to merge 6 commits into from

Conversation

abnud1
Copy link

@abnud1 abnud1 commented Sep 28, 2020

Summary

The only problem is jest-snapshot-serializer-raw, it hasn't been updated for 2 years but tests fail without it and I couldn't find a replacement.

I see only two options here:

  1. migrate the snapshot tests to another serializer or to jest default serializer.
  2. fork jest-snapshot-serializer-raw

Test Plan

run the tests, tests that passed before should not fail after the upgrade, and tests that failed before should fail too

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 28, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8c2616d:

Sandbox Source
React Configuration

@sizebot
Copy link

sizebot commented Sep 28, 2020

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against 8c2616d

@sizebot
Copy link

sizebot commented Sep 28, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 8c2616d

package.json Outdated Show resolved Hide resolved
@gaearon
Copy link
Collaborator

gaearon commented Oct 1, 2020

Looks like there's CI failures. Ideas?

@bvaughn
Copy link
Contributor

bvaughn commented Oct 1, 2020

This one is a lint failure.

TypeError: jest.requireActual is not a function

This one looks to be directly caused by one of the changed files.

@abnud1
Copy link
Author

abnud1 commented Oct 1, 2020

@gaearon the failure happens because fixtures was still using jest 25 in which require.requireActual must be used not jest.requireActual

@abnud1
Copy link
Author

abnud1 commented Oct 1, 2020

@bvaughn the lint failure comes from updating eslint-plugin-jest

@abnud1
Copy link
Author

abnud1 commented Oct 1, 2020

@gaearon Ok it seems that fixtures/dom is still using Jest 25 even after updating the jest version in all package.json files I could find. maybe because of --frozen-lock?

Anyway even after changing jest.requireActual with require.requireActual I get this error now:

TypeError: Cannot read property 'unstable_now' of undefined

This problem is probably because mocking scheduler module didn't work for some reason

@@ -25,5 +25,5 @@ module.exports = {
testSequencer: require.resolve('./jestSequencer'),

// TODO: Upgrade to Jest 26 which uses jsdom 16 by default.
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this line?

Copy link
Author

Choose a reason for hiding this comment

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

unfortunately that didn't fix the problem

Copy link
Contributor

Choose a reason for hiding this comment

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

I just meant removing the todo comment

package.json Show resolved Hide resolved
Copy link
Contributor

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

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

Initially a little skeptical about why bumping dependencies resulted in 25,000+ lines added to the yarn lockfiles.

@matthargett
Copy link
Contributor

Initially a little skeptical about why bumping dependencies resulted in 25,000+ lines added to the yarn lockfiles.

FWIW, the jest repo's yarn.lock has increased more than 10% in the last year. it's over 680kb now. I don't think that by itself should indicate concern or a problem. Since it doesn't have a resulting bundle size impact, would timing a fully-cached 'yarn install' before and after could be enough to quell your skepticism?

@eps1lon eps1lon mentioned this pull request May 27, 2021
2 tasks
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.

None yet

7 participants