diff --git a/README b/README index f19ea02..a933b0e 100644 --- a/README +++ b/README @@ -18,9 +18,29 @@ [![npm version](https://badge.fury.io/js/%40storybook%2Faddon-console.svg)](https://badge.fury.io/js/%40storybook%2Faddon-console) [![addon-console](https://img.shields.io/npm/dt/@storybook/addon-console.svg)](https://github.com/storybooks/storybook-addon-console) +![status: deprecated](https://img.shields.io/badge/status-deprecated-red) [![Storybook](https://raw.githubusercontent.com/storybookjs/storybook-addon-console/master/docs/storybook.svg?sanitize=true)](https://storybookjs.github.io/storybook-addon-console) +## Deprecation and migration + +> [!NOTE] +> This package has been deprecated with the release of Storybook 9. Its features are now natively supported in Storybook. + +You can now log console events globally in your project with a few lines of code: + +```ts +// .storybook/preview.ts +import { spyOn } from 'storybook/test'; + +export const beforeEach(() => { + spyOn(console, 'log').mockName('console.log'); + spyOn(console, 'warn').mockName('console.warn'); +}; +``` + +See the [official documentation on actions](https://storybook.js.org/docs/essentials/actions) for more advanced use cases, like filtering actions. + ## Why There're some cases when you can't / don't want / forgot to keep browser console opened. This addon helps you to get all