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

Upgrade Jest and other test-related libraries #1212

Merged
merged 2 commits into from
Aug 22, 2018

Conversation

julienw
Copy link
Contributor

@julienw julienw commented Aug 21, 2018

No description provided.

@codecov
Copy link

codecov bot commented Aug 21, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@ac17621). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1212   +/-   ##
=========================================
  Coverage          ?   75.82%           
=========================================
  Files             ?      144           
  Lines             ?     9321           
  Branches          ?     2298           
=========================================
  Hits              ?     7068           
  Misses            ?     2012           
  Partials          ?      241

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac17621...252f4f2. Read the comment docs.

"isThrow": false,
"value": undefined,
},
],
Copy link
Contributor Author

@julienw julienw Aug 21, 2018

Choose a reason for hiding this comment

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

mock functions now track results in addition to parameters, that's why we see it in the serialized version too.

Looking at this snapshot, it looks like that addColorStop could be just a jest.fn() instead of a full spyLog in https://github.com/devtools-html/perf.html/blob/87eb4c73b3e75eea24c82e8f7950142402bd905b/src/test/fixtures/mocks/canvas-context.js#L38-L40
Indeed the data seems to be duplicated: we see both the calls to addColorStop above and the mock serialization.

What do you think ? I could do it directly in this PR or in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine however you want to do it.

@@ -334,7 +334,6 @@ exports[`app/Home renders the install screen for the legacy add-on 1`] = `
To start recording a performance profile in Firefox, first install the

<a
className={undefined}
Copy link
Contributor Author

@julienw julienw Aug 21, 2018

Choose a reason for hiding this comment

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

it looks like that when a prop has an undefined value it's not output in snapshots anymore, which seems reasonnable.
This is jestjs/jest#6162

Copy link
Member

Choose a reason for hiding this comment

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

Looks cleaner.

onClick={[Function]}
title="Open the sidebar"
title="Close the sidebar"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

AH the new snapshots are actually what's expected -- this means the tests weren't working properly before :/

Copy link
Contributor Author

@julienw julienw Aug 21, 2018

Choose a reason for hiding this comment

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

This is enzymejs/enzyme#1499 -- and this is a good thing !

Before this we had to call "update" everywhere (I just forgot to do it here). I'm gonna remove them all then ! I can't remove the call to update anywhere else because this is only for shallow and not for mount yet (maybe later ?)

Copy link
Member

Choose a reason for hiding this comment

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

Woops.

@@ -222,7 +222,7 @@ exports[`calltree/ZipFileTree renders a zip file tree 1`] = `
className="treeViewRowColumn treeViewMainColumn name"
>
<a
href="null/from-url//calltree/?file=foo%2Fbar%2Fprofile1.json"
Copy link
Contributor Author

@julienw julienw Aug 21, 2018

Choose a reason for hiding this comment

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

again the window.location change :)

@@ -145,7 +145,7 @@ exports[`app/MenuButtons renders the MenuButtons buttons 1`] = `
className="menuButtonsPermalinkTextField"
readOnly="readOnly"
type="text"
value="about:blank"
value="http://localhost/"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like window.location has a better default value now, see jestjs/jest#6792

@julienw julienw changed the title [WIP] Upgrade Jest and other test-releated libraries Upgrade Jest and other test-releated libraries Aug 21, 2018
@julienw julienw requested a review from gregtatum August 21, 2018 17:20
@julienw
Copy link
Contributor Author

julienw commented Aug 21, 2018

All snapshot changes are actually legit. And the upgrade actually fixed a test...

Copy link
Member

@gregtatum gregtatum left a comment

Choose a reason for hiding this comment

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

Thanks for the upgrades!

onClick={[Function]}
title="Open the sidebar"
title="Close the sidebar"
Copy link
Member

Choose a reason for hiding this comment

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

Woops.

@@ -334,7 +334,6 @@ exports[`app/Home renders the install screen for the legacy add-on 1`] = `
To start recording a performance profile in Firefox, first install the

<a
className={undefined}
Copy link
Member

Choose a reason for hiding this comment

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

Looks cleaner.

"isThrow": false,
"value": undefined,
},
],
Copy link
Member

Choose a reason for hiding this comment

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

I'm fine however you want to do it.

@julienw julienw changed the title Upgrade Jest and other test-releated libraries Upgrade Jest and other test-related libraries Aug 22, 2018
@julienw julienw merged commit 4a1de1c into firefox-devtools:master Aug 22, 2018
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.

2 participants