You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-11Lines changed: 22 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,21 @@
2
2
3
3
Tools to support code coverage in Storybook and the [Storybook test runner](https://github.com/storybookjs/test-runner). It supports Storybook projects that use **Webpack5** or **Vite**.
4
4
5
+
> [!WARNING]
6
+
> If you're using Storybook in a Vite-based project, you might want to use [Storybook's Vitest integration](https://storybook.js.org/docs/writing-tests/integrations/vitest-addon?ref=test-runner-migration) instead. It's faster, provides code coverage out of the box (so you don't need this addon anymore), and integrates well with all Storybook's latest features.
7
+
8
+
## Requirements
9
+
10
+
- Storybook@>=10.0.0
11
+
12
+
### Version compatibility
13
+
14
+
| Addon coverage version | Storybook version |
15
+
| ---------------------- | ----------------- |
16
+
| ^3.0.0 | ^10.0.0 |
17
+
| ^2.0.0 | ^9.0.0 |
18
+
| ^2.0.0 | ^8.0.0 |
19
+
5
20
### Installation
6
21
7
22
Install this addon by adding the `@storybook/addon-coverage` dependency:
@@ -14,7 +29,7 @@ And by registering it in your `.storybook/main.js`:
14
29
15
30
```js
16
31
exportdefault {
17
-
addons: ["@storybook/addon-coverage"],
32
+
addons: ['@storybook/addon-coverage'],
18
33
};
19
34
```
20
35
@@ -26,10 +41,10 @@ This addon instruments your code by using a custom wrapper around [istanbul-lib-
26
41
exportdefault {
27
42
addons: [
28
43
{
29
-
name:"@storybook/addon-coverage",
44
+
name:'@storybook/addon-coverage',
30
45
options: {
31
46
istanbul: {
32
-
include: ["**/stories/**"],
47
+
include: ['**/stories/**'],
33
48
},
34
49
},
35
50
},
@@ -59,7 +74,7 @@ export default {
59
74
> If you're using TypeScript, you can import the type for the options like so:
0 commit comments