Skip to content
This repository was archived by the owner on Jul 29, 2023. It is now read-only.

Files

Latest commit

 

History

History
41 lines (28 loc) · 672 Bytes

README.md

File metadata and controls

41 lines (28 loc) · 672 Bytes

docz-plugin-snapshots

A plugin for docz that creates jest snapshots for all documented component usages

Install

Add the docz-plugin-snapshots package to your project.

yarn add --dev docz-plugin-snapshots

Usage

Add the jest-mdx-loader to your jest.config.js file

/// jest.config.js

module.exports = {
  //...
  transform: {
    "^.+\\.jsx?$": "babel-jest",
    ".mdx?$": "jest-mdx-loader"
  }
  //...
};

Add a new test file and initialize the plugin

/// index.test.js

import initDoczPluginSnapshots from "docz-plugin-snapshots";
initDoczPluginSnapshots("./");

Licence

MIT © Joseph Black