A plugin for docz that creates jest snapshots for all documented component usages
Add the docz-plugin-snapshots package to your project.
yarn add --dev docz-plugin-snapshots
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("./");
MIT © Joseph Black