{"id":14384762,"url":"https://github.com/styleguidist/snapguidist","last_synced_at":"2025-04-05T04:08:38.282Z","repository":{"id":40002852,"uuid":"76097866","full_name":"styleguidist/snapguidist","owner":"styleguidist","description":"Snapshot testing for React Styleguidist","archived":false,"fork":false,"pushed_at":"2018-08-17T10:25:47.000Z","size":796,"stargazers_count":288,"open_issues_count":5,"forks_count":36,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-30T00:00:49.554Z","etag":null,"topics":["jest","react","snapshot-testing","styleguidist"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/styleguidist.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-10T07:34:12.000Z","updated_at":"2024-06-09T05:22:56.000Z","dependencies_parsed_at":"2022-06-26T06:40:14.316Z","dependency_job_id":null,"html_url":"https://github.com/styleguidist/snapguidist","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styleguidist%2Fsnapguidist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styleguidist%2Fsnapguidist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styleguidist%2Fsnapguidist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styleguidist%2Fsnapguidist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/styleguidist","download_url":"https://codeload.github.com/styleguidist/snapguidist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284944,"owners_count":20913704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jest","react","snapshot-testing","styleguidist"],"created_at":"2024-08-28T18:01:38.818Z","updated_at":"2025-04-05T04:08:38.221Z","avatar_url":"https://github.com/styleguidist.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/styleguidist/snapguidist.svg?branch=master)](https://travis-ci.org/styleguidist/snapguidist)\n[![NPM version](https://img.shields.io/npm/v/snapguidist.svg)](https://www.npmjs.com/package/snapguidist)\n[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)\n\n\u003cimg alt=\"Preview\" src=\"logo.png\" width=\"450px\" height=\"166px\" /\u003e\n\n[Jest](https://github.com/facebook/jest) Snapshot Testing for [React Styleguidist](https://github.com/styleguidist/react-styleguidist).\n\n## Demo\n\n![Demo](demo.gif)\n\n## Getting Started\n\nTo add `snapguidist` to your `react-styleguidist` configuration, follow these steps:\n\n1. install the package using yarn or npm:\n\n  ```bash\n  yarn add --dev snapguidist\n  ```\n\n2. enhance the webpack configuration in `styleguide.config.js`:\n\n  ```diff\n  +const snapguidist = require('snapguidist');\n  -module.exports = {\n  +module.exports = snapguidist({\n    components: 'src/components/**/[A-Z]*.js',\n    defaultExample: true,\n    webpackConfig: {\n      module: {\n        rules: [\n          {\n            test: /\\.jsx?$/,\n            exclude: /node_modules/,\n            loader: 'babel-loader',\n          },\n          {\n            test: /\\.css$/,\n            loader: 'style-loader!css-loader',\n          },\n        ],\n      },\n    },\n  -};\n  +});\n  ```\n\n## Migrate to v4\n\nIn v4, snapshots have been renamed to `.sg` (as opposed to `.snap`) to avoid conflicts with Jest, and improve compatibility with [create-react-app](https://github.com/facebook/create-react-app).\n\nOnce upgraded to v4, please run `yarn test -u` to remove the old snapshots (new ones will be automatically generated on the next run)\nor the following commands to rename them:\n```sh\ncd .snapguidist/__snapshots/\nfor old in *.snap; do git mv $old `basename $old .snap`.sg; done\n```\n\n## Example\n\nTo run the example, install the dependencies and start it:\n\n```bash\ncd example\nyarn install\nyarn start\n```\n\n## Development\n\n\u003e Any contribution to `snapguidist` is highly appreciated.\n\nRun the following command from the root folder to enable the *hot-reload*:\n\n```bash\nyarn build:watch \u0026 yarn start\n```\n\n### Credits\n\nLogo by [@SaraVieira](https://github.com/SaraVieira)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyleguidist%2Fsnapguidist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstyleguidist%2Fsnapguidist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyleguidist%2Fsnapguidist/lists"}