New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gooddata/test-storybook

Package Overview
Dependencies
Maintainers
37
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gooddata/test-storybook

Visual regression testing for Storybook

  • 0.1.0-ocetnik-doc-test-storybook-2017-12-07T13-00-17-844Z
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
37
Weekly downloads
 
Created
Source

GoodData Test Storybook

Visual regression testing for Storybook

Usage

Note: Run screenshots tests only on CI to ensure the same environment (platform, browser, display pixel density, etc.)

Preparing environment
  • Ensure you have Chrome 62 or greater installed
Preparing repository where you want to test Storybook
  • Ensure you have your Storybook stories in stories/ folder
  • Run yarn add --dev @gooddata/test-storybook
  • Add "test-storybook": "test-storybook" into "scripts" section in your package.json
  • Ignore logs, test reports and test results in version control. Add these lines into your .gitignore file:
    nohup.out
    start-storybook.log
    test-storybook/ci-report/
    test-storybook/html-report/
    test-storybook/tests/
    
  • Disable testing and linting for test-storybook/ folder
  • Use
    import { SCREENSHOT_WRAPPER_CLASS } from '@gooddata/test-storybook';
    
    in your stories and add SCREENSHOT_WRAPPER_CLASS className for elements that you want to test
Running tests
  • Run yarn test-storybook from the root of your repository in which you want to test Storybook.
  • You should generate initial reference screenshots via -r parameter, i.e. yarn test-storybook -- -r
  • To run tests via GitHub comment you should type extended test - storybook into GitHub PR comment. The link to CI html report appears in GitHub PR comment
Replacement of reference screenshots
  • Download new reference screenshot from CI html report
  • Replace old reference screenshot in test-storybook/references/ folder with new one
  • Commit changes

Release

git checkout master && git pull upstream master
npm version [major|minor|patch]
git commit -am "test-storybook - Release v[your_version]"
npm publish
git push upstream master

Tests

  • Unit tests yarn test
  • Lint JavaScript yarn validate

FAQs

Package last updated on 07 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc