-
-
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
Angular and Vue storyshots #2564
Merged
Merged
Changes from 1 commit
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
97c2b42
Initial dirty-half-working-POC of the storyshots for angular
igor-dv edb1cf6
Refactor storyshots index.js
igor-dv c208016
Refactor test-bodies
igor-dv e0bae92
Better copy-past from app/angular
igor-dv 91f17b6
Remove things
igor-dv 8f549fa
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv 714b694
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv 43a273b
Merge branch 'master' into angular-storyshots
igor-dv d9942cf
Fix indentation in package.json
igor-dv 2c460e4
Extract more stories to separate files
igor-dv 887182f
Support promises in storyshots
igor-dv 9cffe0a
Allow loading html templates
igor-dv 29e84bd
Update snapshots
igor-dv f9e83ca
Merge branch 'master' into angular-storyshots
igor-dv b09b631
Few cleanups
igor-dv 3c782a6
Merge branch 'master' into angular-storyshots
igor-dv 3802a8e
Merge branch 'master' into angular-storyshots
ndelangen 3cbd772
Add vue storyshots fork
igor-dv db89374
Extract common config-loading logic to a separate module
igor-dv 7193eee
Merge remote-tracking branch 'origin/angular-storyshots' into vue-sto…
igor-dv 36daf9c
Use config-loader in vue/loader
igor-dv 5ba2e9e
Use prepare script in storyshots
igor-dv 84237fb
Angular + Jest + Storyshots = Crazy Shit. Move the `jest-preset-angul…
igor-dv 4b612eb
Merge remote-tracking branch 'origin/angular-storyshots' into vue-sto…
igor-dv 796deb5
Merge branch 'master' into angular-storyshots
igor-dv 7fc4888
Define global.STORYBOOK_ENV to be 'vue' because there are addons that…
igor-dv 08cbbc8
Move angular and react to regular reps
igor-dv 51b91d8
Merge remote-tracking branch 'origin/angular-storyshots' into vue-sto…
igor-dv 347bdc2
Add utils.test.js
igor-dv 637a919
Fix indentation
igor-dv a0d4e10
Merge pull request #2614 from storybooks/vue-storyshots
ndelangen ea2db19
Wrap story with app.component like in the app/angular and set dynamic…
igor-dv a1fd3cf
typo and indentation
igor-dv 6a5b3b8
Merge branch 'master' into angular-storyshots
igor-dv c35d48b
Update yarn.lock
igor-dv 3bb8ab9
Move angular back to peer to check if cli tests are failing.
igor-dv 45c7f24
Remove angular and vue deps from storyshots and suppress no-extraneou…
igor-dv ee1fad4
Remove react from deps as well and remove wildcard from react-test-re…
igor-dv a7a6324
Merge branch 'master' into angular-storyshots
igor-dv 3aa07d0
Update yarn.lock
igor-dv 279090c
Disable each specific import separately with ugly "eslint-disable-nex…
igor-dv 7730d21
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv acfd41e
Disable with specific rule, so the imports will be even uglier
igor-dv 23b85f0
Merge branch 'master' into angular-storyshots
igor-dv c4b7ecf
Merge branch 'master' into angular-storyshots
igor-dv 6115fe1
Merge branch 'master' into angular-storyshots
igor-dv 0b57690
Merge branch 'master' into angular-storyshots
igor-dv de37c4b
Merge branch 'master' into angular-storyshots
ndelangen 08ec56b
Merge branch 'master' into angular-storyshots
igor-dv e304771
Add docs for angular and vue
igor-dv 227aaf5
Merge branch 'master' into angular-storyshots
igor-dv 8eee1c0
Now I need to update snapshots...
igor-dv 2aac993
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv 11687bd
After merge fixes
igor-dv b0f4064
Update snapshots
igor-dv ea9adf3
Merge branch 'master' into angular-storyshots
igor-dv c3b5aa7
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv 805f73e
Update snapshots
igor-dv 2e30203
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv a5eb21c
Update storyshots to use helpers with templates support
igor-dv 9ba4b74
Generalize api. import react-test-renderer only in react loader
igor-dv 64506b4
Remove jest-preset-angular and react-test-renderer from deps.
igor-dv cb3029e
Merge branch 'master' into angular-storyshots
igor-dv 2ca902a
Merge branch 'master' into angular-storyshots
igor-dv c2ced8d
Update README
igor-dv 9091f4a
Add deps issue description to README
igor-dv d17f61b
Fix docs
igor-dv f68a410
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv d5b30aa
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv 5fcf200
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv 878aa75
Merge branch 'master' into angular-storyshots
igor-dv 53b9a3a
Fix image snapshot to err on RN
igor-dv 89af8fe
Merge branch 'master' into angular-storyshots
igor-dv db75151
Merge branch 'master' into angular-storyshots
igor-dv 760d3c7
Merge remote-tracking branch 'origin/master' into angular-storyshots
igor-dv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,11 +40,19 @@ Usually, you might already have completed this step. If not, here are some resou | |
|
||
### Configure Jest for React | ||
StoryShots addon for React is dependent on [react-test-renderer](https://github.com/facebook/react/tree/master/packages/react-test-renderer), but | ||
doesn't install it, so you need yo install it separately. | ||
doesn't install it, so you need to install it separately (read [here](#deps-issue) why). | ||
|
||
```sh | ||
npm install --save-dev react-test-renderer | ||
``` | ||
|
||
### Configure Jest for Angular | ||
StoryShots addon for Angular is dependent on [jest-preset-angular](https://github.com/thymikee/jest-preset-angular), but | ||
doesn't install it, so you need yo install it separately. | ||
doesn't install it, so you need to install it separately (read [here](#deps-issue) why). | ||
|
||
```sh | ||
npm install --save-dev jest-preset-angular | ||
``` | ||
|
||
If you already use Jest for testing your angular app - probably you already have the needed jest configuration. | ||
Anyway you can add these lines to your jest config: | ||
|
@@ -62,7 +70,11 @@ module.exports = { | |
``` | ||
### Configure Jest for Vue | ||
StoryShots addon for Vue is dependent on [jest-vue-preprocessor](https://github.com/vire/jest-vue-preprocessor), but | ||
doesn't install it, so you need yo install it separately. | ||
doesn't install it, so you need yo install it separately (read [here](#deps-issue) why). | ||
|
||
```sh | ||
npm install --save-dev jest-vue-preprocessor | ||
``` | ||
|
||
If you already use Jest for testing your vue app - probably you already have the needed jest configuration. | ||
Anyway you can add these lines to your jest config: | ||
|
@@ -75,6 +87,20 @@ module.exports = { | |
moduleFileExtensions: ['vue', 'js', 'jsx', 'json', 'node'], | ||
}; | ||
``` | ||
|
||
### <a name="deps-issue"></a>Why don't we install dependencies of each framework ? | ||
Storyshots addon is currently supporting React, Angular and Vue. Each framework needs its own packages to be integrated with Jest. We don't want people that use only React will need to bring other dependencies that do not make sense for them. | ||
|
||
`dependancies` - will installed an exact version of the particular dep - Storyshots can work with different versions of the same framework (let's say React v16 and React v15), that have to be compatible with a version of its plugin (react-test-renderer). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
`optionalDependencies` - behaves like a regular dependency, but do not fail the installation in case there is a problem to bring the dep. | ||
|
||
`peerDependancies` - listing all the deps in peer will trigger warnings during the installation - we don't want users to install unneeded deps by hand. | ||
|
||
`optionalPeerDependancies` - unfortunately there is nothing like this =( | ||
|
||
For more information read npm [docs](https://docs.npmjs.com/files/package.json#dependencies) | ||
|
||
## Configure Storyshots | ||
|
||
Create a new test file with the name `Storyshots.test.js`. (Or whatever the name you prefer, as long as it matches Jest's config [`testMatch`](http://facebook.github.io/jest/docs/en/configuration.html#testmatch-array-string)). | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It's a super-nit, but I prefer when a sentence keeps making sense if you replace links with their text, that's why I don't really like links with "here" text.
Can we just make "doesn't" a link?