-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 & react-native #2542
Conversation
@@ -1,6 +1,14 @@ | |||
import initStoryshots, { snapshotWithOptions } from '@storybook/addon-storyshots'; | |||
import path from 'path'; | |||
|
|||
jest.mock('global', () => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should actually go in the storyshots addon code
jest.config.js
Outdated
@@ -1,5 +1,5 @@ | |||
module.exports = { | |||
cacheDirectory: '.cache/jest', | |||
// cacheDirectory: '.cache/jest', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might have to revert this
ef6ade2
to
3cfacfe
Compare
navigator.userAgent !== 'storyshots' && | ||
!(navigator.userAgent.indexOf('Node.js') > -1); | ||
!(navigator.userAgent.indexOf('Node.js') > -1) && | ||
!(navigator.userAgent.indexOf('jsdom') > -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main difference with Jest22, it depends on a higher version of jsdom, and is has a new userAgent
@@ -17,7 +16,7 @@ const onClose = action('onClose'); | |||
|
|||
// For some reason react-modal causes an segfault (infinite loop maybe?) | |||
// when rendered by storyshots/react-test-renderer | |||
if (!navigator.userAgent.match(/Node\.js/)) { | |||
if (!navigator.userAgent.match(/Node\.js/) && !navigator.userAgent.match(/jsdom/)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept both for compatibility
@@ -62,14 +62,18 @@ | |||
"glob": "^7.1.2", | |||
"husky": "^0.14.3", | |||
"inquirer": "^4.0.1", | |||
"jest": "^21.2.0", | |||
"jest-cli": "^21.2.1", | |||
"jest": "^22.0.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added these dependencies to make sure the right versions were hoisted to the top level.. It seems CRA has some old version of something
# Conflicts: # examples/cra-kitchen-sink/package.json # package.json # yarn.lock
Codecov Report
@@ Coverage Diff @@
## release/3.3 #2542 +/- ##
===============================================
+ Coverage 20.18% 32.69% +12.5%
===============================================
Files 398 398
Lines 8838 8837 -1
Branches 969 947 -22
===============================================
+ Hits 1784 2889 +1105
+ Misses 6286 5310 -976
+ Partials 768 638 -130
Continue to review full report at Codecov.
|
This should actually fix the bithound status, I'm confused why it's still red |
I've tested RN on iOS, it seems to work just fine |
Can someone else @storybooks/team please verify the RN stuff on their machine? 🙇 |
Hey @ndelangen! How exactly did you fix the issue https://www.codefactor.io/repository/github/storybooks/storybook/pull/fixed/2542?category=Style&groupId=1347 with this PR? |
Issue: -jest is outdated and this is causing bithound to nag us-
What I did