diff --git a/core/webpack-compile/src/args.ts b/core/webpack-compile/src/args.ts index 24c70ea1e..e50566985 100644 --- a/core/webpack-compile/src/args.ts +++ b/core/webpack-compile/src/args.ts @@ -20,6 +20,7 @@ export const defaultCliArgs: ArgOptions = [ alias: 'c', description: 'configuration folder', type: 'string', + default: './.config', }, }, { diff --git a/examples/stories/src/tutorial/testing/jest-snapshots.mdx b/examples/stories/src/tutorial/testing/jest-snapshots.mdx new file mode 100644 index 000000000..a4820a615 --- /dev/null +++ b/examples/stories/src/tutorial/testing/jest-snapshots.mdx @@ -0,0 +1,39 @@ +--- +title: Testing/Jest Snapshots +route: /tutorial/testing/jest-snapshots +type: tutorial +tags: + - testing + - snapshots + - jest + - stories +order: 1 +draft: true +author: atanasster +--- + +## Overview + +The [jest-snapshots](https://github.com/ccontrols/component-controls/tree/master/plugins/jest-snapshots) package automatically creates snapshot tests for your component based on the already created documentation stories. + +- Easy to use cli with "zero" configuration. +- More advanced level to customize the framework renderer. +- Advanced level for full control over which stories to use for the tests. +- Support for a variety of test rendderes starting with [react-test-renderer](https://reactjs.org/docs/test-renderer.html), [react-testing-library](https://testing-library.com/docs/react-testing-library/intro) and [enzyme](https://enzymejs.github.io/enzyme/). + +## Install + +```sh +yarn add @component-controls/jest-snapshots --dev +``` + +## CLI - `cc-jest` + +The command-line interface for jest-snapshots allows for the quickest, zero-config setup. You just need to add a `test` script to your `package.json` file + +```js:title=package.json +"scripts": { + ... + "test": "cc-jest -c ./.config" +}, +``` \ No newline at end of file diff --git a/plugins/jest-snapshots/README.md b/plugins/jest-snapshots/README.md index 18cf1bd9a..90f2dbc76 100644 --- a/plugins/jest-snapshots/README.md +++ b/plugins/jest-snapshots/README.md @@ -6,15 +6,15 @@ - [Install](#install) - [API](#api) -# In action - -[Example site](https://component-controls.com/api/components-actioncontainer--overview/viewport) - # Overview -# Getting Started +- Easy to use cli with "zero" configuration. +- More advanced level to customize the framework renderer. +- Advanced level for full control over which stories to use for the tests. +- Support for a variety of test rendderes starting with [react-test-renderer](https://reactjs.org/docs/test-renderer.html), [react-testing-library](docs) and [enzyme](https://enzymejs.github.io/enzyme/). + -## Install +# Install ```sh yarn add @component-controls/jest-snapshots --dev