![]() Make sure the changes are correct before you continue. You can also use a specialized diffing tool such as Kaleidoscope. Loki will create screenshots of all the tested stories in the loki/current folder in addition to a visual diff placed in the loki/difference folder. yarn loki test laptop will run any configuration containing the word laptop, therefore it's useful to add keywords such as platform (chrome, ios, android) to your configuration names. ![]() You can test a subset of your configurations with a regular expression in the second argument. Run loki again but this time in test mode with yarn loki test. Now it's time to make some changes to your stories or the underlying components that we want to catch with loki! 5. These images should be checked into your git repository, optionally stored using git-lfs. This is done with yarn loki update which by default will create a loki folder to store them in. If it's your first time using loki you need to create the reference images to test your stories against. If you test against iOS simulator or Android emulator, these must also be running the storybook app, start them with react-native run-ios and react-native run-android respectively. You can run React and React Native storybook servers and tests simultaneously as long as they run on different ports. Usually this will be done with yarn storybook. Start Storybookįor loki to be able to access your stories you must start the storybook server. For web this is testing laptop and iPhone configurations using local Chrome app. ![]() The loki init command will detect what type of project it is and add default configurations to your package.json file under the key loki. storybook/preview.js (create it if it doesn't exist already). If you are running an old version, you might need to add import 'loki/configure-react' to. When running a recent version of Storybook, no further integration should be needed. Optionally add loki configuration and integrate as follows: React nativeĪdd import 'loki/configure-react-native' to storybook/storybook.js.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |