Jest Snapshot Testing for React Styleguidist.
To add snapguidist to your react-styleguidist configuration, follow these steps:
- install the package using yarn or npm:
yarn add --dev snapguidist- enhance the webpack configuration in
styleguide.config.js:
+const snapguidist = require('snapguidist');
-module.exports = {
+module.exports = snapguidist({
components: 'src/components/**/[A-Z]*.js',
defaultExample: true,
webpackConfig: {
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.css$/,
loader: 'style-loader!css-loader',
},
],
},
},
-};
+});To run the example, install the dependencies and start it:
cd example
yarn install
yarn startAny contribution to
snapguidistis highly appreciated.
Run the following command from the root folder to enable the hot-reload:
yarn build:watch & yarn startLogo by @SaraVieira

