Conversation
|
Note from commit:
|
|
I pushed some fixed and updated your branch, hope you don't mind 👼 |
| "react-scripts": "0.9.5" | ||
| "react-scripts": "0.9.5", | ||
| "react-test-renderer": "^15.5.4", | ||
| "storyshots": "*" |
There was a problem hiding this comment.
@tmeasday should this also be a file://... dependency like the other ones @ndelangen added? or does lernajs automagically do the right thing here?
There was a problem hiding this comment.
Lerna will do it's thing on that!
Codecov Report
@@ Coverage Diff @@
## master #971 +/- ##
=========================================
Coverage ? 12.51%
=========================================
Files ? 196
Lines ? 4458
Branches ? 713
=========================================
Hits ? 558
Misses ? 3269
Partials ? 631
Continue to review full report at Codecov.
|
|
Can this be used to help along #896 ? |
Hmmm. This test is failing because I changed the dependency in storyshots to a peer dep, and the example project isn't using an addon (so as a result addons never gets installed). I can see two solutions to the problem:
I'm not sure of the best way to do 2. If you make the package a peer dep, and the user isn't using it, they will get a warning from npm, but things will work fine. This seems suboptimal though. The alternative is to just not specify anything in Any advice @ndelangen? |
|
I think not having it as a listed dependency is OK in this case as long as we guard when requiring it. |
|
@tmeasday Do you think you can finish this now? Any more feedback needed? Let me know! |
|
I'll get something going with that technique now. |
Actually this was wrong. Storybooks depends on addons by default. The issue is that due to nested |
|
OK I think I finally resolved this by using the |
| (pkg.devDependencies && pkg.devDependencies['@kadira/react-native-storybook']) || | ||
| (pkg.dependencies && pkg.dependencies['@kadira/react-native-storybook']); | ||
|
|
||
| const hasDependency = function(name) { |
Isn't that the other PR? I think I prefer that too.. |
|
LMK if you want me to rebase this onto #1031 |
|
I was actually working on this / checking it out last evening and got pretty far, but not quite so far tests were passing. I'll work on it some more. I can also push my changes, and have you take a look at it? |
|
@ndelangen Please! |
|
pushed feel free to revert if it's 💩 |
87c33ca to
1c8f8e0
Compare
|
Ok, I think I finally fixed this. The tests should pass 😬 |
|
See commit for more detail: 1c8f8e0 |
shilman
left a comment
There was a problem hiding this comment.
Does the options.mode flag need to be added to docs?
| addons.setChannel(createChannel()); | ||
|
|
||
| const isStorybook = options.mode === 'react' || hasDependency('@storybook/react'); | ||
| const isRNStorybook = options.mode === 'react' || hasDependency('@storybook/react-native'); |
A few things involved: 1. Remove dependencies from storyshots Storyshots wants to plugin to the version used by the app, not have its own version. So it should probably use a peer dep; however as some deps are optional (i.e. react vs react-native) this will lead to confusing warnings to the user. This seems like an OK approach until we hear differently from users. 2. Update test-cra's react-scripts to get it's Jest version up to date 3. Add a `mode` option to storyshots to avoid it auto-detecting if `@storybooks/react[-native]` is installed (this was breaking Jest run from the top-level). 4. Ensure that travis installs the `test-cra` properly
☁️ Nx Cloud ReportCI is running/has finished running commands for commit b5d7247. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Issue:
We didn't have a good way to test storyshots.
What I did
Added storyshots to
test-craapp.How to test