Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/JosephEigenraam/docz-plugin-snapshots

A plugin for docz that creates jest snapshots for all documented component usages
https://github.com/JosephEigenraam/docz-plugin-snapshots

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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

```js
/// jest.config.js

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

Add a new test file and initialize the plugin

```js
/// index.test.js

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

## Licence

MIT © [Joseph Black](https://josephconradblack.com)