@storybook/addon-vitest 11.0.0-beta.3 → 11.0.0-beta.5

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.
@@ -0,0 +1,39 @@
1
+ import {
2
+ require_picocolors
3
+ } from "./chunk-MTTYIP6M.js";
4
+ import {
5
+ ADDON_ID2 as ADDON_ID
6
+ } from "./chunk-G4HWSAOC.js";
7
+ import {
8
+ __toESM
9
+ } from "./chunk-PQZIOGBY.js";
10
+
11
+ // src/logger.ts
12
+ var import_picocolors = __toESM(require_picocolors(), 1);
13
+ import { logger } from "storybook/internal/node-logger";
14
+ var log = (message) => {
15
+ logger.log(
16
+ `${import_picocolors.default.magenta(ADDON_ID)}: ${message.toString().replaceAll(/(│\n|│ )/g, "").trim()}`
17
+ );
18
+ };
19
+
20
+ // src/utils.ts
21
+ function errorToErrorLike(error) {
22
+ return {
23
+ message: error.message,
24
+ name: error.name,
25
+ // avoid duplicating the error message in the stack trace
26
+ stack: error.message + " " + error.stack?.replace(error.message, ""),
27
+ cause: error.cause && error.cause instanceof Error ? errorToErrorLike(error.cause) : void 0
28
+ };
29
+ }
30
+
31
+ // ../../../node_modules/es-toolkit/dist/function/noop.mjs
32
+ function noop() {
33
+ }
34
+
35
+ export {
36
+ log,
37
+ errorToErrorLike,
38
+ noop
39
+ };
@@ -1,15 +1,3 @@
1
- import CJS_COMPAT_NODE_URL_dvfyhpwr65v from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dvfyhpwr65v from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dvfyhpwr65v from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_dvfyhpwr65v.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dvfyhpwr65v.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dvfyhpwr65v.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
-
13
1
  // ../../core/src/component-testing/constants.ts
14
2
  var ADDON_ID = "storybook/interactions", PANEL_ID = `${ADDON_ID}/panel`;
15
3
  var DOCUMENTATION_LINK = "writing-tests/integrations/vitest-addon", DOCUMENTATION_DISCREPANCY_LINK = `${DOCUMENTATION_LINK}#what-happens-when-there-are-different-test-results-in-multiple-environments`;
@@ -1,17 +1,6 @@
1
- import CJS_COMPAT_NODE_URL_dvfyhpwr65v from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dvfyhpwr65v from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dvfyhpwr65v from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_dvfyhpwr65v.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dvfyhpwr65v.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dvfyhpwr65v.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
1
  import {
13
2
  __commonJS
14
- } from "./chunk-VM3B6QLG.js";
3
+ } from "./chunk-PQZIOGBY.js";
15
4
 
16
5
  // ../../../node_modules/picocolors/picocolors.js
17
6
  var require_picocolors = __commonJS({
@@ -1,14 +1,4 @@
1
- import CJS_COMPAT_NODE_URL_dvfyhpwr65v from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dvfyhpwr65v from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dvfyhpwr65v from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_dvfyhpwr65v.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dvfyhpwr65v.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dvfyhpwr65v.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
1
+ import { createRequire as CJS_COMPAT_CREATE_REQUIRE_k0tg52bvvu } from "node:module";var require = CJS_COMPAT_CREATE_REQUIRE_k0tg52bvvu(import.meta.url);
12
2
  var __create = Object.create;
13
3
  var __defProp = Object.defineProperty;
14
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,17 +1,6 @@
1
- import CJS_COMPAT_NODE_URL_dvfyhpwr65v from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dvfyhpwr65v from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dvfyhpwr65v from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_dvfyhpwr65v.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dvfyhpwr65v.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dvfyhpwr65v.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
1
  import {
13
2
  __commonJS
14
- } from "./chunk-VM3B6QLG.js";
3
+ } from "./chunk-PQZIOGBY.js";
15
4
 
16
5
  // ../../../node_modules/ts-dedent/dist/index.js
17
6
  var require_dist = __commonJS({
@@ -1,15 +1,3 @@
1
- import CJS_COMPAT_NODE_URL_dvfyhpwr65v from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dvfyhpwr65v from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dvfyhpwr65v from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_dvfyhpwr65v.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dvfyhpwr65v.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dvfyhpwr65v.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
-
13
1
  // node_modules/pathe/dist/shared/pathe.ff20891b.mjs
14
2
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
15
3
  function normalizeWindowsPath(input = "") {
@@ -132,6 +120,7 @@ export {
132
120
  normalize,
133
121
  join,
134
122
  resolve,
123
+ isAbsolute,
135
124
  relative,
136
125
  dirname,
137
126
  path
@@ -1,15 +1,3 @@
1
- import CJS_COMPAT_NODE_URL_dvfyhpwr65v from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dvfyhpwr65v from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dvfyhpwr65v from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_dvfyhpwr65v.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dvfyhpwr65v.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dvfyhpwr65v.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
-
13
1
  // ../../../node_modules/empathic/find.mjs
14
2
  import { join as join2 } from "node:path";
15
3
  import { existsSync, statSync } from "node:fs";
@@ -1,15 +1,4 @@
1
- import CJS_COMPAT_NODE_URL_dvfyhpwr65v from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dvfyhpwr65v from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dvfyhpwr65v from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_dvfyhpwr65v.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dvfyhpwr65v.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dvfyhpwr65v.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import "./chunk-VM3B6QLG.js";
1
+ import "./chunk-PQZIOGBY.js";
13
2
 
14
3
  // raw:../templates/vitest.config.4.template.ts
15
4
  var vitest_config_4_template_default = `import path from 'node:path';
package/dist/constants.js CHANGED
@@ -1,14 +1,3 @@
1
- import CJS_COMPAT_NODE_URL_dvfyhpwr65v from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dvfyhpwr65v from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dvfyhpwr65v from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_dvfyhpwr65v.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dvfyhpwr65v.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dvfyhpwr65v.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
1
  import {
13
2
  ADDON_ID,
14
3
  ADDON_ID2,
@@ -35,8 +24,8 @@ import {
35
24
  TRIGGER_TEST_RUN_RESPONSE,
36
25
  TUTORIAL_VIDEO_LINK,
37
26
  storeOptions
38
- } from "./_node-chunks/chunk-VLJFF3YI.js";
39
- import "./_node-chunks/chunk-VM3B6QLG.js";
27
+ } from "./_node-chunks/chunk-G4HWSAOC.js";
28
+ import "./_node-chunks/chunk-PQZIOGBY.js";
40
29
  export {
41
30
  ADDON_ID as A11Y_ADDON_ID,
42
31
  PANEL_ID2 as A11Y_PANEL_ID,
@@ -1,19 +1,8 @@
1
- import CJS_COMPAT_NODE_URL_dvfyhpwr65v from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dvfyhpwr65v from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dvfyhpwr65v from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_dvfyhpwr65v.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dvfyhpwr65v.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dvfyhpwr65v.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
1
  import {
13
2
  __commonJS,
14
3
  __require,
15
4
  __toESM
16
- } from "../_node-chunks/chunk-VM3B6QLG.js";
5
+ } from "../_node-chunks/chunk-PQZIOGBY.js";
17
6
 
18
7
  // ../../../node_modules/semver/internal/debug.js
19
8
  var require_debug = __commonJS({
@@ -1,31 +1,19 @@
1
- import CJS_COMPAT_NODE_URL_dvfyhpwr65v from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dvfyhpwr65v from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dvfyhpwr65v from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_dvfyhpwr65v.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dvfyhpwr65v.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dvfyhpwr65v.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
1
  import {
13
2
  errorToErrorLike,
14
- globalThis_,
15
3
  log
16
- } from "../_node-chunks/chunk-6MW37GZ6.js";
4
+ } from "../_node-chunks/chunk-FKKCPNLJ.js";
17
5
  import {
18
6
  any,
19
7
  up
20
- } from "../_node-chunks/chunk-3QQTREGV.js";
21
- import "../_node-chunks/chunk-O6RHQ7RZ.js";
8
+ } from "../_node-chunks/chunk-WQDAJN3N.js";
9
+ import "../_node-chunks/chunk-MTTYIP6M.js";
22
10
  import {
23
11
  dirname,
24
12
  join,
25
13
  normalize,
26
14
  path,
27
15
  resolve
28
- } from "../_node-chunks/chunk-DFLNMLNU.js";
16
+ } from "../_node-chunks/chunk-VDP2ZJQR.js";
29
17
  import {
30
18
  ADDON_ID2 as ADDON_ID,
31
19
  COVERAGE_DIRECTORY,
@@ -34,8 +22,8 @@ import {
34
22
  STORYBOOK_TEST_PROVIDE_KEY,
35
23
  STORY_INDEX_CHANNEL_EVENT_NAME,
36
24
  storeOptions
37
- } from "../_node-chunks/chunk-VLJFF3YI.js";
38
- import "../_node-chunks/chunk-VM3B6QLG.js";
25
+ } from "../_node-chunks/chunk-G4HWSAOC.js";
26
+ import "../_node-chunks/chunk-PQZIOGBY.js";
39
27
 
40
28
  // src/node/vitest.ts
41
29
  import process2 from "node:process";
@@ -71,40 +59,6 @@ function debounce(func, debounceMs, { signal, edges } = {}) {
71
59
  return debounced.schedule = schedule, debounced.cancel = cancel, debounced.flush = flush, signal?.addEventListener("abort", cancel, { once: !0 }), debounced;
72
60
  }
73
61
 
74
- // ../../../node_modules/es-toolkit/dist/function/partial.mjs
75
- function partial(func, ...partialArgs) {
76
- return partialImpl(func, placeholderSymbol, ...partialArgs);
77
- }
78
- function partialImpl(func, placeholder, ...partialArgs) {
79
- let partialed = function(...providedArgs) {
80
- let providedArgsIndex = 0, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg), remainingArgs = providedArgs.slice(providedArgsIndex);
81
- return func.apply(this, substitutedArgs.concat(remainingArgs));
82
- };
83
- return func.prototype && (partialed.prototype = Object.create(func.prototype)), partialed;
84
- }
85
- var placeholderSymbol = /* @__PURE__ */ Symbol("partial.placeholder");
86
- partial.placeholder = placeholderSymbol;
87
-
88
- // ../../../node_modules/es-toolkit/dist/function/partialRight.mjs
89
- function partialRight(func, ...partialArgs) {
90
- return partialRightImpl(func, placeholderSymbol2, ...partialArgs);
91
- }
92
- function partialRightImpl(func, placeholder, ...partialArgs) {
93
- let partialedRight = function(...providedArgs) {
94
- let placeholderLength = partialArgs.filter((arg) => arg === placeholder).length, rangeLength = Math.max(providedArgs.length - placeholderLength, 0), remainingArgs = providedArgs.slice(0, rangeLength), providedArgsIndex = rangeLength, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg);
95
- return func.apply(this, remainingArgs.concat(substitutedArgs));
96
- };
97
- return func.prototype && (partialedRight.prototype = Object.create(func.prototype)), partialedRight;
98
- }
99
- var placeholderSymbol2 = /* @__PURE__ */ Symbol("partialRight.placeholder");
100
- partialRight.placeholder = placeholderSymbol2;
101
-
102
- // ../../../node_modules/es-toolkit/dist/_internal/DOMException.mjs
103
- var DOMException = typeof globalThis_.DOMException < "u" ? globalThis_.DOMException : Error;
104
-
105
- // ../../../node_modules/es-toolkit/dist/function/retry.mjs
106
- var DEFAULT_RETRIES = Number.POSITIVE_INFINITY;
107
-
108
62
  // ../../../node_modules/es-toolkit/dist/function/throttle.mjs
109
63
  function throttle(func, throttleMs, { signal, edges = ["leading", "trailing"] } = {}) {
110
64
  let pendingAt = null, debounced = debounce(function(...args) {
@@ -128,9 +82,6 @@ import { getProjectRoot, resolvePathInStorybookCache } from "storybook/internal/
128
82
  import { Tag } from "storybook/internal/core-server";
129
83
  import { logger } from "storybook/internal/node-logger";
130
84
 
131
- // ../../../node_modules/es-toolkit/dist/string/words.mjs
132
- var CASE_SPLIT_PATTERN = new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+", "gu");
133
-
134
85
  // ../../../node_modules/es-toolkit/dist/string/escapeRegExp.mjs
135
86
  function escapeRegExp(str) {
136
87
  return str.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
@@ -1,32 +1,21 @@
1
- import CJS_COMPAT_NODE_URL_dvfyhpwr65v from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dvfyhpwr65v from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dvfyhpwr65v from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_dvfyhpwr65v.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dvfyhpwr65v.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dvfyhpwr65v.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
1
  import {
13
2
  any
14
- } from "./_node-chunks/chunk-3QQTREGV.js";
3
+ } from "./_node-chunks/chunk-WQDAJN3N.js";
15
4
  import {
16
5
  require_dist
17
- } from "./_node-chunks/chunk-YXGVPF7B.js";
6
+ } from "./_node-chunks/chunk-QKPKKS4R.js";
18
7
  import {
19
8
  dirname,
20
9
  normalize,
21
10
  relative,
22
11
  resolve
23
- } from "./_node-chunks/chunk-DFLNMLNU.js";
12
+ } from "./_node-chunks/chunk-VDP2ZJQR.js";
24
13
  import {
25
14
  DOCUMENTATION_LINK
26
- } from "./_node-chunks/chunk-VLJFF3YI.js";
15
+ } from "./_node-chunks/chunk-G4HWSAOC.js";
27
16
  import {
28
17
  __toESM
29
- } from "./_node-chunks/chunk-VM3B6QLG.js";
18
+ } from "./_node-chunks/chunk-PQZIOGBY.js";
30
19
 
31
20
  // src/postinstall.ts
32
21
  import * as fs from "node:fs/promises";
@@ -130,7 +119,7 @@ import {
130
119
  staticKey
131
120
  } from "storybook/internal/csf-tools";
132
121
  async function getTemplatePath() {
133
- return import("./_node-chunks/vitest.config.4.template-QCDTOEPV.js");
122
+ return import("./_node-chunks/vitest.config.4.template-3K4YNNG3.js");
134
123
  }
135
124
  var loadTemplate = async (name, replacements) => {
136
125
  let template = (await getTemplatePath()).default;