@storybook/addon-vitest 0.0.0-pr-33718-sha-304eb5aa → 0.0.0-pr-33718-sha-7a5f4d76

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.
Files changed (24) hide show
  1. package/dist/_node-chunks/{chunk-FDQAGQW7.js → chunk-5EL3NO4W.js} +7 -7
  2. package/dist/_node-chunks/{chunk-5D2VLZWH.js → chunk-BE25SYKA.js} +7 -7
  3. package/dist/_node-chunks/{chunk-4KAHNQEU.js → chunk-FA6IK6W4.js} +7 -7
  4. package/dist/_node-chunks/{chunk-GB77AV6Z.js → chunk-GEO5JBDX.js} +9 -9
  5. package/dist/_node-chunks/{chunk-ZWUZ4CQG.js → chunk-KBNBKJEJ.js} +6 -6
  6. package/dist/_node-chunks/{chunk-QUMQO7XH.js → chunk-UB57P2QH.js} +6 -6
  7. package/dist/_node-chunks/{chunk-QBKELSME.js → chunk-Z4JBRZ7X.js} +12 -7
  8. package/dist/_node-chunks/{chunk-VLDYM7RW.js → chunk-ZUQHZHRC.js} +6 -6
  9. package/dist/_node-chunks/vitest.config.3.2.template-7NCSJMBP.js +53 -0
  10. package/dist/_node-chunks/vitest.config.4.template-AA6R57LS.js +55 -0
  11. package/dist/_node-chunks/vitest.config.template-L2XMIG7Y.js +53 -0
  12. package/dist/_node-chunks/vitest.workspace.template-AYXV2TJB.js +50 -0
  13. package/dist/node/coverage-reporter.js +8 -8
  14. package/dist/node/vitest.js +12 -12
  15. package/dist/postinstall.js +27 -26
  16. package/dist/preset.js +148 -17
  17. package/dist/vitest-plugin/global-setup.js +7 -7
  18. package/dist/vitest-plugin/index.js +10 -10
  19. package/package.json +2 -2
  20. package/dist/_node-chunks/chunk-XZTZ6DAN.js +0 -158
  21. /package/templates/{vitest.config.3.2.template.ts → vitest.config.3.2.template.txt} +0 -0
  22. /package/templates/{vitest.config.4.template.ts → vitest.config.4.template.txt} +0 -0
  23. /package/templates/{vitest.config.template.ts → vitest.config.template.txt} +0 -0
  24. /package/templates/{vitest.workspace.template.ts → vitest.workspace.template.txt} +0 -0
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.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
  __commonJS
14
- } from "./chunk-QBKELSME.js";
14
+ } from "./chunk-Z4JBRZ7X.js";
15
15
 
16
16
  // ../../../node_modules/ts-dedent/dist/index.js
17
17
  var require_dist = __commonJS({
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.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
  __commonJS
14
- } from "./chunk-QBKELSME.js";
14
+ } from "./chunk-Z4JBRZ7X.js";
15
15
 
16
16
  // ../../../node_modules/semver/internal/constants.js
17
17
  var require_constants = __commonJS({
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.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
  __commonJS
14
- } from "./chunk-QBKELSME.js";
14
+ } from "./chunk-Z4JBRZ7X.js";
15
15
 
16
16
  // ../../../node_modules/picocolors/picocolors.js
17
17
  var require_picocolors = __commonJS({
@@ -1,23 +1,23 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.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
  ADDON_ID
14
- } from "./chunk-QUMQO7XH.js";
14
+ } from "./chunk-UB57P2QH.js";
15
15
  import {
16
16
  require_picocolors
17
- } from "./chunk-4KAHNQEU.js";
17
+ } from "./chunk-FA6IK6W4.js";
18
18
  import {
19
19
  __toESM
20
- } from "./chunk-QBKELSME.js";
20
+ } from "./chunk-Z4JBRZ7X.js";
21
21
 
22
22
  // src/logger.ts
23
23
  var import_picocolors = __toESM(require_picocolors(), 1);
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -19,7 +19,11 @@ var __require = /* @__PURE__ */ ((x) => typeof require < "u" ? require : typeof
19
19
  }) : x)(function(x) {
20
20
  if (typeof require < "u") return require.apply(this, arguments);
21
21
  throw Error('Dynamic require of "' + x + '" is not supported');
22
- });
22
+ }), __glob = (map) => (path) => {
23
+ var fn = map[path];
24
+ if (fn) return fn();
25
+ throw new Error("Module not found in bundle: " + path);
26
+ };
23
27
  var __commonJS = (cb, mod) => function() {
24
28
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
25
29
  };
@@ -40,6 +44,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
40
44
 
41
45
  export {
42
46
  __require,
47
+ __glob,
43
48
  __commonJS,
44
49
  __toESM
45
50
  };
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -0,0 +1,53 @@
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import "./chunk-Z4JBRZ7X.js";
13
+
14
+ // templates/vitest.config.3.2.template.txt
15
+ var vitest_config_3_2_template_default = `import path from 'node:path';
16
+ import { fileURLToPath } from 'node:url';
17
+
18
+ import { defineConfig } from 'vitest/config';
19
+
20
+ import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
21
+
22
+ const dirname =
23
+ typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
24
+
25
+ // More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
26
+ export default defineConfig({
27
+ test: {
28
+ projects: [
29
+ {
30
+ extends: true,
31
+ plugins: [
32
+ // The plugin will run tests for the stories defined in your Storybook config
33
+ // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
34
+ storybookTest({ configDir: path.join(dirname, 'CONFIG_DIR') }),
35
+ ],
36
+ test: {
37
+ name: 'storybook',
38
+ browser: {
39
+ enabled: true,
40
+ headless: true,
41
+ provider: 'playwright',
42
+ instances: [{ browser: 'chromium' }],
43
+ },
44
+ setupFiles: ['SETUP_FILE'],
45
+ },
46
+ },
47
+ ],
48
+ },
49
+ });
50
+ `;
51
+ export {
52
+ vitest_config_3_2_template_default as default
53
+ };
@@ -0,0 +1,55 @@
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import "./chunk-Z4JBRZ7X.js";
13
+
14
+ // templates/vitest.config.4.template.txt
15
+ var vitest_config_4_template_default = `import path from 'node:path';
16
+ import { fileURLToPath } from 'node:url';
17
+
18
+ import { defineConfig } from 'vitest/config';
19
+
20
+ import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
21
+
22
+ import { playwright } from '@vitest/browser-playwright';
23
+
24
+ const dirname =
25
+ typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
26
+
27
+ // More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
28
+ export default defineConfig({
29
+ test: {
30
+ projects: [
31
+ {
32
+ extends: true,
33
+ plugins: [
34
+ // The plugin will run tests for the stories defined in your Storybook config
35
+ // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
36
+ storybookTest({ configDir: path.join(dirname, 'CONFIG_DIR') }),
37
+ ],
38
+ test: {
39
+ name: 'storybook',
40
+ browser: {
41
+ enabled: true,
42
+ headless: true,
43
+ provider: playwright({}),
44
+ instances: [{ browser: 'chromium' }],
45
+ },
46
+ setupFiles: ['SETUP_FILE'],
47
+ },
48
+ },
49
+ ],
50
+ },
51
+ });
52
+ `;
53
+ export {
54
+ vitest_config_4_template_default as default
55
+ };
@@ -0,0 +1,53 @@
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import "./chunk-Z4JBRZ7X.js";
13
+
14
+ // templates/vitest.config.template.txt
15
+ var vitest_config_template_default = `import path from 'node:path';
16
+ import { fileURLToPath } from 'node:url';
17
+
18
+ import { defineConfig } from 'vitest/config';
19
+
20
+ import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
21
+
22
+ const dirname =
23
+ typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
24
+
25
+ // More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
26
+ export default defineConfig({
27
+ test: {
28
+ workspace: [
29
+ {
30
+ extends: true,
31
+ plugins: [
32
+ // The plugin will run tests for the stories defined in your Storybook config
33
+ // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
34
+ storybookTest({ configDir: path.join(dirname, 'CONFIG_DIR') }),
35
+ ],
36
+ test: {
37
+ name: 'storybook',
38
+ browser: {
39
+ enabled: true,
40
+ headless: true,
41
+ provider: 'playwright',
42
+ instances: [{ browser: 'chromium' }],
43
+ },
44
+ setupFiles: ['SETUP_FILE'],
45
+ },
46
+ },
47
+ ],
48
+ },
49
+ });
50
+ `;
51
+ export {
52
+ vitest_config_template_default as default
53
+ };
@@ -0,0 +1,50 @@
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import "./chunk-Z4JBRZ7X.js";
13
+
14
+ // templates/vitest.workspace.template.txt
15
+ var vitest_workspace_template_default = `import path from 'node:path';
16
+ import { fileURLToPath } from 'node:url';
17
+
18
+ import { defineWorkspace } from 'vitest/config';
19
+
20
+ import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
21
+
22
+ const dirname =
23
+ typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
24
+
25
+ // More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
26
+ export default defineWorkspace([
27
+ 'ROOT_CONFIG',
28
+ {
29
+ extends: 'EXTENDS_WORKSPACE',
30
+ plugins: [
31
+ // The plugin will run tests for the stories defined in your Storybook config
32
+ // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
33
+ storybookTest({ configDir: path.join(dirname, 'CONFIG_DIR') }),
34
+ ],
35
+ test: {
36
+ name: 'storybook',
37
+ browser: {
38
+ enabled: true,
39
+ headless: true,
40
+ provider: 'playwright',
41
+ instances: [{ browser: 'chromium' }],
42
+ },
43
+ setupFiles: ['SETUP_FILE'],
44
+ },
45
+ },
46
+ ]);
47
+ `;
48
+ export {
49
+ vitest_workspace_template_default as default
50
+ };
@@ -1,22 +1,22 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.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_gte
14
- } from "../_node-chunks/chunk-5D2VLZWH.js";
14
+ } from "../_node-chunks/chunk-BE25SYKA.js";
15
15
  import {
16
16
  __commonJS,
17
17
  __require,
18
18
  __toESM
19
- } from "../_node-chunks/chunk-QBKELSME.js";
19
+ } from "../_node-chunks/chunk-Z4JBRZ7X.js";
20
20
 
21
21
  // ../../../node_modules/istanbul-lib-report/node_modules/make-dir/index.js
22
22
  var require_make_dir = __commonJS({
@@ -1,35 +1,35 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.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
  log
14
- } from "../_node-chunks/chunk-GB77AV6Z.js";
14
+ } from "../_node-chunks/chunk-GEO5JBDX.js";
15
15
  import {
16
16
  any
17
- } from "../_node-chunks/chunk-ZWUZ4CQG.js";
17
+ } from "../_node-chunks/chunk-KBNBKJEJ.js";
18
18
  import {
19
19
  ADDON_ID,
20
20
  COVERAGE_DIRECTORY,
21
21
  STATUS_TYPE_ID_A11Y,
22
22
  STATUS_TYPE_ID_COMPONENT_TEST,
23
23
  storeOptions
24
- } from "../_node-chunks/chunk-QUMQO7XH.js";
25
- import "../_node-chunks/chunk-4KAHNQEU.js";
24
+ } from "../_node-chunks/chunk-UB57P2QH.js";
25
+ import "../_node-chunks/chunk-FA6IK6W4.js";
26
26
  import {
27
27
  dirname,
28
28
  join,
29
29
  normalize,
30
30
  path
31
- } from "../_node-chunks/chunk-VLDYM7RW.js";
32
- import "../_node-chunks/chunk-QBKELSME.js";
31
+ } from "../_node-chunks/chunk-ZUQHZHRC.js";
32
+ import "../_node-chunks/chunk-Z4JBRZ7X.js";
33
33
 
34
34
  // src/node/vitest.ts
35
35
  import process2 from "node:process";
@@ -1,33 +1,29 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
- import {
13
- resolvePackageDir
14
- } from "./_node-chunks/chunk-XZTZ6DAN.js";
15
12
  import {
16
13
  any
17
- } from "./_node-chunks/chunk-ZWUZ4CQG.js";
14
+ } from "./_node-chunks/chunk-KBNBKJEJ.js";
18
15
  import {
19
16
  DOCUMENTATION_LINK
20
- } from "./_node-chunks/chunk-QUMQO7XH.js";
17
+ } from "./_node-chunks/chunk-UB57P2QH.js";
21
18
  import {
22
19
  require_dist
23
- } from "./_node-chunks/chunk-FDQAGQW7.js";
20
+ } from "./_node-chunks/chunk-5EL3NO4W.js";
24
21
  import {
25
22
  dirname,
26
- join,
27
23
  normalize,
28
24
  relative,
29
25
  resolve
30
- } from "./_node-chunks/chunk-VLDYM7RW.js";
26
+ } from "./_node-chunks/chunk-ZUQHZHRC.js";
31
27
  import {
32
28
  require_compare,
33
29
  require_constants,
@@ -37,11 +33,12 @@ import {
37
33
  require_parse_options,
38
34
  require_re,
39
35
  require_semver
40
- } from "./_node-chunks/chunk-5D2VLZWH.js";
36
+ } from "./_node-chunks/chunk-BE25SYKA.js";
41
37
  import {
42
38
  __commonJS,
39
+ __glob,
43
40
  __toESM
44
- } from "./_node-chunks/chunk-QBKELSME.js";
41
+ } from "./_node-chunks/chunk-Z4JBRZ7X.js";
45
42
 
46
43
  // ../../../node_modules/semver/functions/parse.js
47
44
  var require_parse = __commonJS({
@@ -873,7 +870,7 @@ var require_semver2 = __commonJS({
873
870
 
874
871
  // src/postinstall.ts
875
872
  import { existsSync } from "node:fs";
876
- import * as fs2 from "node:fs/promises";
873
+ import * as fs from "node:fs/promises";
877
874
  import { writeFile } from "node:fs/promises";
878
875
  import { babelParse, generate, traverse } from "storybook/internal/babel";
879
876
  import { AddonVitestService } from "storybook/internal/cli";
@@ -895,13 +892,17 @@ import {
895
892
  import { SupportedFramework } from "storybook/internal/types";
896
893
  var import_semver = __toESM(require_semver2(), 1), import_ts_dedent = __toESM(require_dist(), 1);
897
894
 
895
+ // import("../templates/**/*") in src/updateVitestFile.ts
896
+ var globImport_templates = __glob({
897
+ "../templates/vitest.config.3.2.template.txt": () => import("./_node-chunks/vitest.config.3.2.template-7NCSJMBP.js"),
898
+ "../templates/vitest.config.4.template.txt": () => import("./_node-chunks/vitest.config.4.template-AA6R57LS.js"),
899
+ "../templates/vitest.config.template.txt": () => import("./_node-chunks/vitest.config.template-L2XMIG7Y.js"),
900
+ "../templates/vitest.workspace.template.txt": () => import("./_node-chunks/vitest.workspace.template-AYXV2TJB.js")
901
+ });
902
+
898
903
  // src/updateVitestFile.ts
899
- import * as fs from "node:fs/promises";
900
904
  var loadTemplate = async (name, replacements) => {
901
- let template = await fs.readFile(
902
- join(resolvePackageDir("@storybook/addon-vitest"), "templates", name),
903
- "utf8"
904
- );
905
+ let template = (await globImport_templates(`../templates/${name}`)).default;
905
906
  return Object.entries(replacements).forEach(
906
907
  ([key, value]) => template = template.replace(key, normalize(value))
907
908
  ), template;
@@ -1146,16 +1147,16 @@ async function postInstall(options) {
1146
1147
  "vitest.shims.d.ts",
1147
1148
  isVitest4OrNewer ? '/// <reference types="@vitest/browser-playwright" />' : '/// <reference types="@vitest/browser/providers/playwright" />'
1148
1149
  );
1149
- let getTemplateName = () => isVitest4OrNewer ? "vitest.config.4.template.ts" : isVitest3_2To4 ? "vitest.config.3.2.template.ts" : "vitest.config.template.ts";
1150
+ let getTemplateName = () => isVitest4OrNewer ? "vitest.config.4.template.txt" : isVitest3_2To4 ? "vitest.config.3.2.template.txt" : "vitest.config.template.txt";
1150
1151
  if (vitestWorkspaceFile) {
1151
- let workspaceFileContent = await fs2.readFile(vitestWorkspaceFile, "utf8");
1152
+ let workspaceFileContent = await fs.readFile(vitestWorkspaceFile, "utf8");
1152
1153
  if (isConfigAlreadySetup(vitestWorkspaceFile, workspaceFileContent)) {
1153
1154
  logger.step(
1154
1155
  CLI_COLORS.success("Vitest for Storybook is already properly configured. Skipping setup.")
1155
1156
  );
1156
1157
  return;
1157
1158
  }
1158
- let workspaceTemplate = await loadTemplate("vitest.workspace.template.ts", {
1159
+ let workspaceTemplate = await loadTemplate("vitest.workspace.template.txt", {
1159
1160
  EXTENDS_WORKSPACE: viteConfigFile ? relative(dirname(vitestWorkspaceFile), viteConfigFile) : "",
1160
1161
  CONFIG_DIR: options.configDir,
1161
1162
  SETUP_FILE: relative(dirname(vitestWorkspaceFile), existingSetupFile ?? vitestSetupFile)
@@ -1181,7 +1182,7 @@ async function postInstall(options) {
1181
1182
  new AddonVitestPostinstallWorkspaceUpdateError({ filePath: vitestWorkspaceFile })
1182
1183
  );
1183
1184
  } else if (rootConfig) {
1184
- let target, updated, configFile = await fs2.readFile(rootConfig, "utf8"), configFileHasTypeReference = configFile.match(
1185
+ let target, updated, configFile = await fs.readFile(rootConfig, "utf8"), configFileHasTypeReference = configFile.match(
1185
1186
  /\/\/\/\s*<reference\s+types=["']vitest\/config["']\s*\/>/
1186
1187
  ), templateName = getTemplateName(), alreadyConfigured = isConfigAlreadySetup(rootConfig, configFile);
1187
1188
  if (templateName && !alreadyConfigured) {
package/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,10 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
12
12
  import {
13
13
  log,
14
14
  noop
15
- } from "./_node-chunks/chunk-GB77AV6Z.js";
16
- import {
17
- importMetaResolve
18
- } from "./_node-chunks/chunk-XZTZ6DAN.js";
15
+ } from "./_node-chunks/chunk-GEO5JBDX.js";
19
16
  import {
20
17
  ADDON_ID,
21
18
  COVERAGE_DIRECTORY,
@@ -24,19 +21,19 @@ import {
24
21
  STORYBOOK_ADDON_TEST_CHANNEL,
25
22
  TEST_PROVIDER_STORE_CHANNEL_EVENT_NAME,
26
23
  storeOptions
27
- } from "./_node-chunks/chunk-QUMQO7XH.js";
24
+ } from "./_node-chunks/chunk-UB57P2QH.js";
28
25
  import {
29
26
  require_picocolors
30
- } from "./_node-chunks/chunk-4KAHNQEU.js";
27
+ } from "./_node-chunks/chunk-FA6IK6W4.js";
31
28
  import {
32
29
  require_dist
33
- } from "./_node-chunks/chunk-FDQAGQW7.js";
30
+ } from "./_node-chunks/chunk-5EL3NO4W.js";
34
31
  import {
35
32
  normalize
36
- } from "./_node-chunks/chunk-VLDYM7RW.js";
33
+ } from "./_node-chunks/chunk-ZUQHZHRC.js";
37
34
  import {
38
35
  __toESM
39
- } from "./_node-chunks/chunk-QBKELSME.js";
36
+ } from "./_node-chunks/chunk-Z4JBRZ7X.js";
40
37
 
41
38
  // src/preset.ts
42
39
  import { mkdir } from "node:fs/promises";
@@ -210,13 +207,147 @@ function isEqual(a, b) {
210
207
  var import_picocolors = __toESM(require_picocolors(), 1), import_ts_dedent = __toESM(require_dist(), 1);
211
208
 
212
209
  // src/node/boot-test-runner.ts
213
- import { fileURLToPath } from "node:url";
210
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
214
211
  import { executeNodeCommand } from "storybook/internal/common";
215
212
  import {
216
213
  internal_universalStatusStore,
217
214
  internal_universalTestProviderStore
218
215
  } from "storybook/internal/core-server";
219
- var MAX_START_TIME = 3e4, vitestModulePath = fileURLToPath(importMetaResolve("@storybook/addon-vitest/vitest")), eventQueue = [], child, ready = !1, unsubscribeStore, unsubscribeStatusStore, unsubscribeTestProviderStore, forwardUniversalStoreEvent = (storeEventName) => (event, eventInfo) => {
216
+
217
+ // ../../core/src/shared/utils/module.ts
218
+ import { fileURLToPath, pathToFileURL } from "node:url";
219
+
220
+ // ../../../node_modules/exsolve/dist/index.mjs
221
+ import assert from "node:assert";
222
+ import v8 from "node:v8";
223
+ import { format, inspect } from "node:util";
224
+ var own$1 = {}.hasOwnProperty, classRegExp = /^([A-Z][a-z\d]*)+$/, kTypes = /* @__PURE__ */ new Set([
225
+ "string",
226
+ "function",
227
+ "number",
228
+ "object",
229
+ "Function",
230
+ "Object",
231
+ "boolean",
232
+ "bigint",
233
+ "symbol"
234
+ ]), messages = /* @__PURE__ */ new Map(), nodeInternalPrefix = "__node_internal_", userStackTraceLimit;
235
+ function formatList(array, type = "and") {
236
+ return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
237
+ }
238
+ function createError(sym, value, constructor) {
239
+ return messages.set(sym, value), makeNodeErrorWithCode(constructor, sym);
240
+ }
241
+ function makeNodeErrorWithCode(Base, key) {
242
+ return function(...parameters) {
243
+ let limit = Error.stackTraceLimit;
244
+ isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = 0);
245
+ let error = new Base();
246
+ isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = limit);
247
+ let message = getMessage(key, parameters, error);
248
+ return Object.defineProperties(error, {
249
+ message: {
250
+ value: message,
251
+ enumerable: !1,
252
+ writable: !0,
253
+ configurable: !0
254
+ },
255
+ toString: {
256
+ value() {
257
+ return `${this.name} [${key}]: ${this.message}`;
258
+ },
259
+ enumerable: !1,
260
+ writable: !0,
261
+ configurable: !0
262
+ }
263
+ }), captureLargerStackTrace(error), error.code = key, error;
264
+ };
265
+ }
266
+ function isErrorStackTraceLimitWritable() {
267
+ try {
268
+ if (v8.startupSnapshot.isBuildingSnapshot()) return !1;
269
+ } catch {
270
+ }
271
+ let desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
272
+ return desc === void 0 ? Object.isExtensible(Error) : own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
273
+ }
274
+ function hideStackFrames(wrappedFunction) {
275
+ let hidden = nodeInternalPrefix + wrappedFunction.name;
276
+ return Object.defineProperty(wrappedFunction, "name", { value: hidden }), wrappedFunction;
277
+ }
278
+ var captureLargerStackTrace = hideStackFrames(function(error) {
279
+ let stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
280
+ return stackTraceLimitIsWritable && (userStackTraceLimit = Error.stackTraceLimit, Error.stackTraceLimit = Number.POSITIVE_INFINITY), Error.captureStackTrace(error), stackTraceLimitIsWritable && (Error.stackTraceLimit = userStackTraceLimit), error;
281
+ });
282
+ function getMessage(key, parameters, self) {
283
+ let message = messages.get(key);
284
+ if (assert.ok(message !== void 0, "expected `message` to be found"), typeof message == "function")
285
+ return assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`), Reflect.apply(message, self, parameters);
286
+ let regex = /%[dfijoOs]/g, expectedLength = 0;
287
+ for (; regex.exec(message) !== null; ) expectedLength++;
288
+ return assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`), parameters.length === 0 ? message : (parameters.unshift(message), Reflect.apply(format, null, parameters));
289
+ }
290
+ function determineSpecificType(value) {
291
+ if (value == null) return String(value);
292
+ if (typeof value == "function" && value.name) return `function ${value.name}`;
293
+ if (typeof value == "object")
294
+ return value.constructor && value.constructor.name ? `an instance of ${value.constructor.name}` : `${inspect(value, { depth: -1 })}`;
295
+ let inspected = inspect(value, { colors: !1 });
296
+ return inspected.length > 28 && (inspected = `${inspected.slice(0, 25)}...`), `type ${typeof value} (${inspected})`;
297
+ }
298
+ var ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
299
+ assert.ok(typeof name == "string", "'name' must be a string"), Array.isArray(expected) || (expected = [expected]);
300
+ let message = "The ";
301
+ if (name.endsWith(" argument")) message += `${name} `;
302
+ else {
303
+ let type = name.includes(".") ? "property" : "argument";
304
+ message += `"${name}" ${type} `;
305
+ }
306
+ message += "must be ";
307
+ let types = [], instances = [], other = [];
308
+ for (let value of expected)
309
+ assert.ok(typeof value == "string", "All expected entries have to be of type string"), kTypes.has(value) ? types.push(value.toLowerCase()) : classRegExp.exec(value) === null ? (assert.ok(value !== "object", 'The value "object" should be written as "Object"'), other.push(value)) : instances.push(value);
310
+ if (instances.length > 0) {
311
+ let pos = types.indexOf("object");
312
+ pos !== -1 && (types.slice(pos, 1), instances.push("Object"));
313
+ }
314
+ return types.length > 0 && (message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`, (instances.length > 0 || other.length > 0) && (message += " or ")), instances.length > 0 && (message += `an instance of ${formatList(instances, "or")}`, other.length > 0 && (message += " or ")), other.length > 0 && (other.length > 1 ? message += `one of ${formatList(other, "or")}` : (other[0]?.toLowerCase() !== other[0] && (message += "an "), message += `${other[0]}`)), message += `. Received ${determineSpecificType(actual)}`, message;
315
+ }, TypeError), ERR_INVALID_MODULE_SPECIFIER = createError(
316
+ "ERR_INVALID_MODULE_SPECIFIER",
317
+ /**
318
+ * @param {string} request
319
+ * @param {string} reason
320
+ * @param {string} [base]
321
+ */
322
+ (request, reason, base) => `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`,
323
+ TypeError
324
+ ), ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path$1, base, message) => `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`, Error), ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = !1, base) => {
325
+ let relatedError = typeof target == "string" && !isImport && target.length > 0 && !target.startsWith("./");
326
+ return key === "." ? (assert.ok(isImport === !1), `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`) : `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
327
+ }, Error), ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path$1, base, exactUrl = !1) => `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`, Error), ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error), ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`, TypeError), ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
328
+ "ERR_PACKAGE_PATH_NOT_EXPORTED",
329
+ /**
330
+ * @param {string} packagePath
331
+ * @param {string} subpath
332
+ * @param {string} [base]
333
+ */
334
+ (packagePath, subpath, base) => subpath === "." ? `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}` : `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`,
335
+ Error
336
+ ), ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error), ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError), ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path$1) => `Unknown file extension "${extension}" for ${path$1}`, TypeError), ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
337
+ let inspected = inspect(value);
338
+ return inspected.length > 128 && (inspected = `${inspected.slice(0, 128)}...`), `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
339
+ }, TypeError), hasOwnProperty$1 = {}.hasOwnProperty;
340
+ var hasOwnProperty = {}.hasOwnProperty;
341
+ var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace], own = {}.hasOwnProperty;
342
+ var isWindows = process.platform === "win32", globalCache = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
343
+
344
+ // ../../core/src/shared/utils/module.ts
345
+ var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
346
+ "importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
347
+ ), pathToFileURL(args[0]).href) : import.meta.resolve(...args);
348
+
349
+ // src/node/boot-test-runner.ts
350
+ var MAX_START_TIME = 3e4, vitestModulePath = fileURLToPath2(importMetaResolve("@storybook/addon-vitest/vitest")), eventQueue = [], child, ready = !1, unsubscribeStore, unsubscribeStatusStore, unsubscribeTestProviderStore, forwardUniversalStoreEvent = (storeEventName) => (event, eventInfo) => {
220
351
  child?.send({
221
352
  type: storeEventName,
222
353
  args: [{ event, eventInfo }],
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -13,7 +13,7 @@ import {
13
13
  __commonJS,
14
14
  __require,
15
15
  __toESM
16
- } from "../_node-chunks/chunk-QBKELSME.js";
16
+ } from "../_node-chunks/chunk-Z4JBRZ7X.js";
17
17
 
18
18
  // ../../../node_modules/tree-kill/index.js
19
19
  var require_tree_kill = __commonJS({
@@ -1,20 +1,20 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_hkragztkg5g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hkragztkg5g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hkragztkg5g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_hkragztkg5g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hkragztkg5g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hkragztkg5g.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-4KAHNQEU.js";
14
+ } from "../_node-chunks/chunk-FA6IK6W4.js";
15
15
  import {
16
16
  require_dist
17
- } from "../_node-chunks/chunk-FDQAGQW7.js";
17
+ } from "../_node-chunks/chunk-5EL3NO4W.js";
18
18
  import {
19
19
  join,
20
20
  normalize,
@@ -22,12 +22,12 @@ import {
22
22
  relative,
23
23
  resolve,
24
24
  sep
25
- } from "../_node-chunks/chunk-VLDYM7RW.js";
25
+ } from "../_node-chunks/chunk-ZUQHZHRC.js";
26
26
  import {
27
27
  __commonJS,
28
28
  __require,
29
29
  __toESM
30
- } from "../_node-chunks/chunk-QBKELSME.js";
30
+ } from "../_node-chunks/chunk-Z4JBRZ7X.js";
31
31
 
32
32
  // ../../../node_modules/braces/lib/utils.js
33
33
  var require_utils = __commonJS({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-vitest",
3
- "version": "0.0.0-pr-33718-sha-304eb5aa",
3
+ "version": "0.0.0-pr-33718-sha-7a5f4d76",
4
4
  "description": "Storybook Vitest addon: Blazing fast component testing using stories",
5
5
  "keywords": [
6
6
  "storybook",
@@ -99,7 +99,7 @@
99
99
  "@vitest/browser": "^3.0.0 || ^4.0.0",
100
100
  "@vitest/browser-playwright": "^4.0.0",
101
101
  "@vitest/runner": "^3.0.0 || ^4.0.0",
102
- "storybook": "^0.0.0-pr-33718-sha-304eb5aa",
102
+ "storybook": "^0.0.0-pr-33718-sha-7a5f4d76",
103
103
  "vitest": "^3.0.0 || ^4.0.0"
104
104
  },
105
105
  "peerDependenciesMeta": {
@@ -1,158 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_3wlpwxyesb5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_3wlpwxyesb5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_3wlpwxyesb5 from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_3wlpwxyesb5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_3wlpwxyesb5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_3wlpwxyesb5.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- dirname,
14
- join
15
- } from "./chunk-VLDYM7RW.js";
16
-
17
- // ../../core/src/shared/utils/module.ts
18
- import { fileURLToPath, pathToFileURL } from "node:url";
19
-
20
- // ../../../node_modules/exsolve/dist/index.mjs
21
- import assert from "node:assert";
22
- import v8 from "node:v8";
23
- import { format, inspect } from "node:util";
24
- var own$1 = {}.hasOwnProperty, classRegExp = /^([A-Z][a-z\d]*)+$/, kTypes = /* @__PURE__ */ new Set([
25
- "string",
26
- "function",
27
- "number",
28
- "object",
29
- "Function",
30
- "Object",
31
- "boolean",
32
- "bigint",
33
- "symbol"
34
- ]), messages = /* @__PURE__ */ new Map(), nodeInternalPrefix = "__node_internal_", userStackTraceLimit;
35
- function formatList(array, type = "and") {
36
- return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
37
- }
38
- function createError(sym, value, constructor) {
39
- return messages.set(sym, value), makeNodeErrorWithCode(constructor, sym);
40
- }
41
- function makeNodeErrorWithCode(Base, key) {
42
- return function(...parameters) {
43
- let limit = Error.stackTraceLimit;
44
- isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = 0);
45
- let error = new Base();
46
- isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = limit);
47
- let message = getMessage(key, parameters, error);
48
- return Object.defineProperties(error, {
49
- message: {
50
- value: message,
51
- enumerable: !1,
52
- writable: !0,
53
- configurable: !0
54
- },
55
- toString: {
56
- value() {
57
- return `${this.name} [${key}]: ${this.message}`;
58
- },
59
- enumerable: !1,
60
- writable: !0,
61
- configurable: !0
62
- }
63
- }), captureLargerStackTrace(error), error.code = key, error;
64
- };
65
- }
66
- function isErrorStackTraceLimitWritable() {
67
- try {
68
- if (v8.startupSnapshot.isBuildingSnapshot()) return !1;
69
- } catch {
70
- }
71
- let desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
72
- return desc === void 0 ? Object.isExtensible(Error) : own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
73
- }
74
- function hideStackFrames(wrappedFunction) {
75
- let hidden = nodeInternalPrefix + wrappedFunction.name;
76
- return Object.defineProperty(wrappedFunction, "name", { value: hidden }), wrappedFunction;
77
- }
78
- var captureLargerStackTrace = hideStackFrames(function(error) {
79
- let stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
80
- return stackTraceLimitIsWritable && (userStackTraceLimit = Error.stackTraceLimit, Error.stackTraceLimit = Number.POSITIVE_INFINITY), Error.captureStackTrace(error), stackTraceLimitIsWritable && (Error.stackTraceLimit = userStackTraceLimit), error;
81
- });
82
- function getMessage(key, parameters, self) {
83
- let message = messages.get(key);
84
- if (assert.ok(message !== void 0, "expected `message` to be found"), typeof message == "function")
85
- return assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`), Reflect.apply(message, self, parameters);
86
- let regex = /%[dfijoOs]/g, expectedLength = 0;
87
- for (; regex.exec(message) !== null; ) expectedLength++;
88
- return assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`), parameters.length === 0 ? message : (parameters.unshift(message), Reflect.apply(format, null, parameters));
89
- }
90
- function determineSpecificType(value) {
91
- if (value == null) return String(value);
92
- if (typeof value == "function" && value.name) return `function ${value.name}`;
93
- if (typeof value == "object")
94
- return value.constructor && value.constructor.name ? `an instance of ${value.constructor.name}` : `${inspect(value, { depth: -1 })}`;
95
- let inspected = inspect(value, { colors: !1 });
96
- return inspected.length > 28 && (inspected = `${inspected.slice(0, 25)}...`), `type ${typeof value} (${inspected})`;
97
- }
98
- var ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
99
- assert.ok(typeof name == "string", "'name' must be a string"), Array.isArray(expected) || (expected = [expected]);
100
- let message = "The ";
101
- if (name.endsWith(" argument")) message += `${name} `;
102
- else {
103
- let type = name.includes(".") ? "property" : "argument";
104
- message += `"${name}" ${type} `;
105
- }
106
- message += "must be ";
107
- let types = [], instances = [], other = [];
108
- for (let value of expected)
109
- assert.ok(typeof value == "string", "All expected entries have to be of type string"), kTypes.has(value) ? types.push(value.toLowerCase()) : classRegExp.exec(value) === null ? (assert.ok(value !== "object", 'The value "object" should be written as "Object"'), other.push(value)) : instances.push(value);
110
- if (instances.length > 0) {
111
- let pos = types.indexOf("object");
112
- pos !== -1 && (types.slice(pos, 1), instances.push("Object"));
113
- }
114
- return types.length > 0 && (message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`, (instances.length > 0 || other.length > 0) && (message += " or ")), instances.length > 0 && (message += `an instance of ${formatList(instances, "or")}`, other.length > 0 && (message += " or ")), other.length > 0 && (other.length > 1 ? message += `one of ${formatList(other, "or")}` : (other[0]?.toLowerCase() !== other[0] && (message += "an "), message += `${other[0]}`)), message += `. Received ${determineSpecificType(actual)}`, message;
115
- }, TypeError), ERR_INVALID_MODULE_SPECIFIER = createError(
116
- "ERR_INVALID_MODULE_SPECIFIER",
117
- /**
118
- * @param {string} request
119
- * @param {string} reason
120
- * @param {string} [base]
121
- */
122
- (request, reason, base) => `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`,
123
- TypeError
124
- ), ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path$1, base, message) => `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`, Error), ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = !1, base) => {
125
- let relatedError = typeof target == "string" && !isImport && target.length > 0 && !target.startsWith("./");
126
- return key === "." ? (assert.ok(isImport === !1), `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`) : `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
127
- }, Error), ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path$1, base, exactUrl = !1) => `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`, Error), ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error), ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`, TypeError), ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
128
- "ERR_PACKAGE_PATH_NOT_EXPORTED",
129
- /**
130
- * @param {string} packagePath
131
- * @param {string} subpath
132
- * @param {string} [base]
133
- */
134
- (packagePath, subpath, base) => subpath === "." ? `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}` : `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`,
135
- Error
136
- ), ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error), ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError), ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path$1) => `Unknown file extension "${extension}" for ${path$1}`, TypeError), ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
137
- let inspected = inspect(value);
138
- return inspected.length > 128 && (inspected = `${inspected.slice(0, 128)}...`), `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
139
- }, TypeError), hasOwnProperty$1 = {}.hasOwnProperty;
140
- var hasOwnProperty = {}.hasOwnProperty;
141
- var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace], own = {}.hasOwnProperty;
142
- var isWindows = process.platform === "win32", globalCache = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
143
-
144
- // ../../core/src/shared/utils/module.ts
145
- var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
146
- "importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
147
- ), pathToFileURL(args[0]).href) : import.meta.resolve(...args), resolvePackageDir = (pkg, parent) => {
148
- try {
149
- return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"), parent)));
150
- } catch {
151
- return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"))));
152
- }
153
- };
154
-
155
- export {
156
- importMetaResolve,
157
- resolvePackageDir
158
- };