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

deps(jest): upgrade to 27.0.3 #12454

Merged
merged 8 commits into from
Jun 2, 2021
Merged

deps(jest): upgrade to 27.0.3 #12454

merged 8 commits into from
Jun 2, 2021

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented May 7, 2021

This is the latest beta release. The latest official release does not yet have #7792, and I'm fed up with manually fixing things when using -u, so here we are.

You can verify the new feature works by adding a number to:

https://github.com/GoogleChrome/lighthouse/blob/30ebe53/lighthouse-core/audits/script-treemap-data.js#L209

and running yarn jest script-treemap-data -u. Only the inline snapshot strings will change.

@connorjclark connorjclark requested a review from a team as a code owner May 7, 2021 21:04
@connorjclark connorjclark requested review from patrickhulce and removed request for a team May 7, 2021 21:04
@google-cla google-cla bot added the cla: yes label May 7, 2021
@@ -103,7 +103,6 @@ describe('ReportUIFeatures', () => {
global.I18n = undefined;
global.ReportUIFeatures = undefined;
global.matchMedia = undefined;
global.self.matchMedia = undefined;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I.... have no idea how this was working ... but I am extremely curious.

maybe before global.self === global and now it does not? In Chrome self === globalThis.self, so circular global object references makes some sort of sense, but maybe Jest decided to remove that behavior for global.

@@ -119,17 +119,21 @@ describe('lightrider-entry', () => {
runStub.mockRestore();
});

let originalRun;
Copy link
Collaborator Author

@connorjclark connorjclark May 7, 2021

Choose a reason for hiding this comment

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

jestjs/jest#9828 disallowed these functions from being nested in a test case.

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh dang yeah, I did not expect that to work haha

@@ -119,17 +119,21 @@ describe('lightrider-entry', () => {
runStub.mockRestore();
});

let originalRun;
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh dang yeah, I did not expect that to work haha

@connorjclark
Copy link
Collaborator Author

The afterAll hook in the viewer puppeteer test is hanging. I found that server.close is not resolving ...

@@ -79,7 +79,7 @@ describe('Lighthouse Viewer', () => {
if (pageErrors.length > 0) console.error(pageErrors);

await Promise.all([
new Promise(resolve => server.close(resolve)),
server.close(),
Copy link
Collaborator Author

@connorjclark connorjclark May 7, 2021

Choose a reason for hiding this comment

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

Another brainteaser!

server.close doesn't take any parameters. This file is not typechecked, so this wasn't caught. If this were a raw http.Server object, it would work as written. This mistake happened because of the StaticServer refactor.

The brainteaser is... why did this ever work? I suppose before, Jest simply gave up at some point and shutdown. But now it will fail if afterPass hangs.

@connorjclark connorjclark changed the title deps(jest): upgrade to 27.0.0-next.9 deps(jest): upgrade to 27.0.3 Jun 1, 2021
@brendankenny
Copy link
Member

can we avoid updating our test runner before the release which depends on our test runner, though :)

@connorjclark
Copy link
Collaborator Author

this can land whenever idc. i had 10 minutes to kill to i upgraded the pr

@connorjclark connorjclark merged commit cea31a1 into master Jun 2, 2021
@connorjclark connorjclark deleted the jest-upgrade branch June 2, 2021 21:01
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.

4 participants