@storybook/addon-vitest 0.0.0-pr-32874-sha-fd398904 → 0.0.0-pr-32921-sha-16b7aab0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_x7l8djn52xj from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_x7l8djn52xj from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_x7l8djn52xj from "node:module";
1
+ import CJS_COMPAT_NODE_URL_6px7swmj8pe from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_6px7swmj8pe from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_6px7swmj8pe from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_x7l8djn52xj.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_x7l8djn52xj.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_x7l8djn52xj.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_6px7swmj8pe.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_6px7swmj8pe.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_6px7swmj8pe.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -14,7 +14,7 @@ import {
14
14
  __name,
15
15
  __require,
16
16
  __toESM
17
- } from "../_node-chunks/chunk-LB44Z253.js";
17
+ } from "../_node-chunks/chunk-XJAFV5RM.js";
18
18
 
19
19
  // ../../node_modules/tree-kill/index.js
20
20
  var require_tree_kill = __commonJS({
@@ -1,30 +1,30 @@
1
- import CJS_COMPAT_NODE_URL_x7l8djn52xj from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_x7l8djn52xj from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_x7l8djn52xj from "node:module";
1
+ import CJS_COMPAT_NODE_URL_6px7swmj8pe from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_6px7swmj8pe from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_6px7swmj8pe from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_x7l8djn52xj.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_x7l8djn52xj.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_x7l8djn52xj.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_6px7swmj8pe.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_6px7swmj8pe.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_6px7swmj8pe.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  require_picocolors
14
- } from "../_node-chunks/chunk-NQQ2WBZM.js";
14
+ } from "../_node-chunks/chunk-EYRCMB52.js";
15
15
  import {
16
16
  join,
17
17
  normalize,
18
18
  relative,
19
19
  resolve,
20
20
  sep
21
- } from "../_node-chunks/chunk-ZIYTWRWN.js";
21
+ } from "../_node-chunks/chunk-YT4V4DMB.js";
22
22
  import {
23
23
  __commonJS,
24
24
  __name,
25
25
  __require,
26
26
  __toESM
27
- } from "../_node-chunks/chunk-LB44Z253.js";
27
+ } from "../_node-chunks/chunk-XJAFV5RM.js";
28
28
 
29
29
  // ../../node_modules/braces/lib/utils.js
30
30
  var require_utils = __commonJS({
@@ -3683,6 +3683,7 @@ var storybookTest = /* @__PURE__ */ __name(async (options) => {
3683
3683
  join(relative(finalOptions.vitestRoot, process.cwd()), "**/*.mdx").replaceAll(sep, "/")
3684
3684
  ],
3685
3685
  // if the existing deps.inline is true, we keep it as-is, because it will inline everything
3686
+ // TODO: Remove the check once we don't support Vitest 3 anymore
3686
3687
  ...nonMutableInputConfig.test?.server?.deps?.inline !== true ? {
3687
3688
  server: {
3688
3689
  deps: {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PANEL_ID
3
- } from "../_browser-chunks/chunk-PMYV6BH2.js";
3
+ } from "../_browser-chunks/chunk-RPDOPHZX.js";
4
4
  import {
5
5
  __name
6
6
  } from "../_browser-chunks/chunk-JK72E6FR.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-vitest",
3
- "version": "0.0.0-pr-32874-sha-fd398904",
3
+ "version": "0.0.0-pr-32921-sha-16b7aab0",
4
4
  "description": "Storybook Vitest addon: Blazing fast component testing using stories",
5
5
  "keywords": [
6
6
  "storybook",
@@ -74,7 +74,6 @@
74
74
  "dependencies": {
75
75
  "@storybook/global": "^5.0.0",
76
76
  "@storybook/icons": "^1.6.0",
77
- "prompts": "^2.4.0",
78
77
  "ts-dedent": "^2.2.0"
79
78
  },
80
79
  "devDependencies": {
@@ -82,9 +81,8 @@
82
81
  "@types/micromatch": "^4.0.0",
83
82
  "@types/node": "^22.0.0",
84
83
  "@types/semver": "^7",
85
- "@vitest/browser": "^3.2.4",
86
- "@vitest/runner": "^3.2.4",
87
- "boxen": "^8.0.1",
84
+ "@vitest/browser-playwright": "^4.0.1",
85
+ "@vitest/runner": "^4.0.1",
88
86
  "empathic": "^2.0.0",
89
87
  "es-toolkit": "^1.36.0",
90
88
  "execa": "^8.0.1",
@@ -101,18 +99,22 @@
101
99
  "tree-kill": "^1.2.2",
102
100
  "ts-dedent": "^2.2.0",
103
101
  "typescript": "^5.8.3",
104
- "vitest": "^3.2.4"
102
+ "vitest": "^4.0.1"
105
103
  },
106
104
  "peerDependencies": {
107
- "@vitest/browser": "^3.0.0",
108
- "@vitest/runner": "^3.0.0",
109
- "storybook": "^0.0.0-pr-32874-sha-fd398904",
110
- "vitest": "^3.0.0"
105
+ "@vitest/browser": "^3.0.0 || ^4.0.0",
106
+ "@vitest/browser-playwright": "^4.0.0",
107
+ "@vitest/runner": "^3.0.0 || ^4.0.0",
108
+ "storybook": "^0.0.0-pr-32921-sha-16b7aab0",
109
+ "vitest": "^3.0.0 || ^4.0.0"
111
110
  },
112
111
  "peerDependenciesMeta": {
113
112
  "@vitest/browser": {
114
113
  "optional": true
115
114
  },
115
+ "@vitest/browser-playwright": {
116
+ "optional": true
117
+ },
116
118
  "@vitest/runner": {
117
119
  "optional": true
118
120
  },
@@ -21,7 +21,12 @@ export default defineConfig({
21
21
  ],
22
22
  test: {
23
23
  name: 'storybook',
24
- browser: BROWSER_CONFIG,
24
+ browser: {
25
+ enabled: true,
26
+ headless: true,
27
+ provider: 'playwright',
28
+ instances: [{ browser: 'chromium' }],
29
+ },
25
30
  setupFiles: ['SETUP_FILE'],
26
31
  },
27
32
  },
@@ -0,0 +1,37 @@
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+
4
+ import { defineConfig } from 'vitest/config';
5
+
6
+ import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
7
+
8
+ import { playwright } from '@vitest/browser-playwright';
9
+
10
+ const dirname =
11
+ typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
12
+
13
+ // More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
14
+ export default defineConfig({
15
+ test: {
16
+ projects: [
17
+ {
18
+ extends: true,
19
+ plugins: [
20
+ // The plugin will run tests for the stories defined in your Storybook config
21
+ // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
22
+ storybookTest({ configDir: path.join(dirname, 'CONFIG_DIR') }),
23
+ ],
24
+ test: {
25
+ name: 'storybook',
26
+ browser: {
27
+ enabled: true,
28
+ headless: true,
29
+ provider: playwright({}),
30
+ instances: [{ browser: 'chromium' }],
31
+ },
32
+ setupFiles: ['SETUP_FILE'],
33
+ },
34
+ },
35
+ ],
36
+ },
37
+ });
@@ -21,7 +21,12 @@ export default defineConfig({
21
21
  ],
22
22
  test: {
23
23
  name: 'storybook',
24
- browser: BROWSER_CONFIG,
24
+ browser: {
25
+ enabled: true,
26
+ headless: true,
27
+ provider: 'playwright',
28
+ instances: [{ browser: 'chromium' }],
29
+ },
25
30
  setupFiles: ['SETUP_FILE'],
26
31
  },
27
32
  },
@@ -20,7 +20,12 @@ export default defineWorkspace([
20
20
  ],
21
21
  test: {
22
22
  name: 'storybook',
23
- browser: BROWSER_CONFIG,
23
+ browser: {
24
+ enabled: true,
25
+ headless: true,
26
+ provider: 'playwright',
27
+ instances: [{ browser: 'chromium' }],
28
+ },
24
29
  setupFiles: ['SETUP_FILE'],
25
30
  },
26
31
  },