@storybook/addon-vitest 10.0.0-beta.6 → 10.0.0-beta.8

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_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.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
  __name
14
- } from "./chunk-W34P2AWY.js";
14
+ } from "./chunk-JCPCXLQR.js";
15
15
 
16
16
  // src/utils.ts
17
17
  function getAddonNames(mainConfig) {
@@ -1,24 +1,24 @@
1
- import CJS_COMPAT_NODE_URL_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.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-GGPSQDLA.js";
14
+ } from "./chunk-2I6HEIHF.js";
15
15
  import {
16
16
  require_picocolors
17
- } from "./chunk-NUDB275Q.js";
17
+ } from "./chunk-VQZJG5ES.js";
18
18
  import {
19
19
  __name,
20
20
  __toESM
21
- } from "./chunk-W34P2AWY.js";
21
+ } from "./chunk-JCPCXLQR.js";
22
22
 
23
23
  // src/logger.ts
24
24
  var import_picocolors = __toESM(require_picocolors(), 1);
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.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
  __name
14
- } from "./chunk-W34P2AWY.js";
14
+ } from "./chunk-JCPCXLQR.js";
15
15
 
16
16
  // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
17
17
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.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_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
12
12
  import {
13
13
  __commonJS,
14
14
  __name
15
- } from "./chunk-W34P2AWY.js";
15
+ } from "./chunk-JCPCXLQR.js";
16
16
 
17
17
  // ../../node_modules/semver/internal/constants.js
18
18
  var require_constants = __commonJS({
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
12
12
  import {
13
13
  __commonJS,
14
14
  __name
15
- } from "./chunk-W34P2AWY.js";
15
+ } from "./chunk-JCPCXLQR.js";
16
16
 
17
17
  // ../../node_modules/picocolors/picocolors.js
18
18
  var require_picocolors = __commonJS({
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,13 +12,13 @@ var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
12
12
  import {
13
13
  dirname,
14
14
  join
15
- } from "./chunk-ZOV2V4R2.js";
15
+ } from "./chunk-BQNZ4G5P.js";
16
16
  import {
17
17
  __commonJS,
18
18
  __name,
19
19
  __require,
20
20
  __toESM
21
- } from "./chunk-W34P2AWY.js";
21
+ } from "./chunk-JCPCXLQR.js";
22
22
 
23
23
  // ../../node_modules/isexe/windows.js
24
24
  var require_windows = __commonJS({
@@ -161,22 +161,22 @@ var require_isexe = __commonJS({
161
161
  // ../../node_modules/which/which.js
162
162
  var require_which = __commonJS({
163
163
  "../../node_modules/which/which.js"(exports, module) {
164
- var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
164
+ var isWindows2 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
165
165
  var path3 = __require("path");
166
- var COLON = isWindows ? ";" : ":";
166
+ var COLON = isWindows2 ? ";" : ":";
167
167
  var isexe = require_isexe();
168
168
  var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError");
169
169
  var getPathInfo = /* @__PURE__ */ __name((cmd, opt) => {
170
170
  const colon = opt.colon || COLON;
171
- const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
171
+ const pathEnv = cmd.match(/\//) || isWindows2 && cmd.match(/\\/) ? [""] : [
172
172
  // windows always checks the cwd first
173
- ...isWindows ? [process.cwd()] : [],
173
+ ...isWindows2 ? [process.cwd()] : [],
174
174
  ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
175
175
  "").split(colon)
176
176
  ];
177
- const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
178
- const pathExt = isWindows ? pathExtExe.split(colon) : [""];
179
- if (isWindows) {
177
+ const pathExtExe = isWindows2 ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
178
+ const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
179
+ if (isWindows2) {
180
180
  if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
181
181
  pathExt.unshift("");
182
182
  }
@@ -2243,6 +2243,316 @@ __name(execaNode, "execaNode");
2243
2243
 
2244
2244
  // ../../core/src/shared/utils/module.ts
2245
2245
  import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
2246
+
2247
+ // ../../node_modules/exsolve/dist/index.mjs
2248
+ import assert from "node:assert";
2249
+ import v8 from "node:v8";
2250
+ import { format, inspect } from "node:util";
2251
+ var own$1 = {}.hasOwnProperty;
2252
+ var classRegExp = /^([A-Z][a-z\d]*)+$/;
2253
+ var kTypes = /* @__PURE__ */ new Set([
2254
+ "string",
2255
+ "function",
2256
+ "number",
2257
+ "object",
2258
+ // Accept 'Function' and 'Object' as alternative to the lower cased version.
2259
+ "Function",
2260
+ "Object",
2261
+ "boolean",
2262
+ "bigint",
2263
+ "symbol"
2264
+ ]);
2265
+ var messages = /* @__PURE__ */ new Map();
2266
+ var nodeInternalPrefix = "__node_internal_";
2267
+ var userStackTraceLimit;
2268
+ function formatList(array, type = "and") {
2269
+ return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
2270
+ }
2271
+ __name(formatList, "formatList");
2272
+ function createError(sym, value, constructor) {
2273
+ messages.set(sym, value);
2274
+ return makeNodeErrorWithCode(constructor, sym);
2275
+ }
2276
+ __name(createError, "createError");
2277
+ function makeNodeErrorWithCode(Base, key) {
2278
+ return /* @__PURE__ */ __name(function NodeError(...parameters) {
2279
+ const limit = Error.stackTraceLimit;
2280
+ if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
2281
+ const error = new Base();
2282
+ if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
2283
+ const message = getMessage(key, parameters, error);
2284
+ Object.defineProperties(error, {
2285
+ // Note: no need to implement `kIsNodeError` symbol, would be hard,
2286
+ // probably.
2287
+ message: {
2288
+ value: message,
2289
+ enumerable: false,
2290
+ writable: true,
2291
+ configurable: true
2292
+ },
2293
+ toString: {
2294
+ /** @this {Error} */
2295
+ value() {
2296
+ return `${this.name} [${key}]: ${this.message}`;
2297
+ },
2298
+ enumerable: false,
2299
+ writable: true,
2300
+ configurable: true
2301
+ }
2302
+ });
2303
+ captureLargerStackTrace(error);
2304
+ error.code = key;
2305
+ return error;
2306
+ }, "NodeError");
2307
+ }
2308
+ __name(makeNodeErrorWithCode, "makeNodeErrorWithCode");
2309
+ function isErrorStackTraceLimitWritable() {
2310
+ try {
2311
+ if (v8.startupSnapshot.isBuildingSnapshot()) {
2312
+ return false;
2313
+ }
2314
+ } catch {
2315
+ }
2316
+ const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
2317
+ if (desc === void 0) {
2318
+ return Object.isExtensible(Error);
2319
+ }
2320
+ return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
2321
+ }
2322
+ __name(isErrorStackTraceLimitWritable, "isErrorStackTraceLimitWritable");
2323
+ function hideStackFrames(wrappedFunction) {
2324
+ const hidden = nodeInternalPrefix + wrappedFunction.name;
2325
+ Object.defineProperty(wrappedFunction, "name", { value: hidden });
2326
+ return wrappedFunction;
2327
+ }
2328
+ __name(hideStackFrames, "hideStackFrames");
2329
+ var captureLargerStackTrace = hideStackFrames(function(error) {
2330
+ const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
2331
+ if (stackTraceLimitIsWritable) {
2332
+ userStackTraceLimit = Error.stackTraceLimit;
2333
+ Error.stackTraceLimit = Number.POSITIVE_INFINITY;
2334
+ }
2335
+ Error.captureStackTrace(error);
2336
+ if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
2337
+ return error;
2338
+ });
2339
+ function getMessage(key, parameters, self) {
2340
+ const message = messages.get(key);
2341
+ assert(message !== void 0, "expected `message` to be found");
2342
+ if (typeof message === "function") {
2343
+ assert(
2344
+ message.length <= parameters.length,
2345
+ // Default options do not count.
2346
+ `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
2347
+ );
2348
+ return Reflect.apply(message, self, parameters);
2349
+ }
2350
+ const regex = /%[dfijoOs]/g;
2351
+ let expectedLength = 0;
2352
+ while (regex.exec(message) !== null) expectedLength++;
2353
+ assert(
2354
+ expectedLength === parameters.length,
2355
+ `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
2356
+ );
2357
+ if (parameters.length === 0) return message;
2358
+ parameters.unshift(message);
2359
+ return Reflect.apply(format, null, parameters);
2360
+ }
2361
+ __name(getMessage, "getMessage");
2362
+ function determineSpecificType(value) {
2363
+ if (value === null || value === void 0) {
2364
+ return String(value);
2365
+ }
2366
+ if (typeof value === "function" && value.name) {
2367
+ return `function ${value.name}`;
2368
+ }
2369
+ if (typeof value === "object") {
2370
+ if (value.constructor && value.constructor.name) {
2371
+ return `an instance of ${value.constructor.name}`;
2372
+ }
2373
+ return `${inspect(value, { depth: -1 })}`;
2374
+ }
2375
+ let inspected = inspect(value, { colors: false });
2376
+ if (inspected.length > 28) {
2377
+ inspected = `${inspected.slice(0, 25)}...`;
2378
+ }
2379
+ return `type ${typeof value} (${inspected})`;
2380
+ }
2381
+ __name(determineSpecificType, "determineSpecificType");
2382
+ createError(
2383
+ "ERR_INVALID_ARG_TYPE",
2384
+ (name, expected, actual) => {
2385
+ assert(typeof name === "string", "'name' must be a string");
2386
+ if (!Array.isArray(expected)) {
2387
+ expected = [expected];
2388
+ }
2389
+ let message = "The ";
2390
+ if (name.endsWith(" argument")) {
2391
+ message += `${name} `;
2392
+ } else {
2393
+ const type = name.includes(".") ? "property" : "argument";
2394
+ message += `"${name}" ${type} `;
2395
+ }
2396
+ message += "must be ";
2397
+ const types = [];
2398
+ const instances = [];
2399
+ const other = [];
2400
+ for (const value of expected) {
2401
+ assert(
2402
+ typeof value === "string",
2403
+ "All expected entries have to be of type string"
2404
+ );
2405
+ if (kTypes.has(value)) {
2406
+ types.push(value.toLowerCase());
2407
+ } else if (classRegExp.exec(value) === null) {
2408
+ assert(
2409
+ value !== "object",
2410
+ 'The value "object" should be written as "Object"'
2411
+ );
2412
+ other.push(value);
2413
+ } else {
2414
+ instances.push(value);
2415
+ }
2416
+ }
2417
+ if (instances.length > 0) {
2418
+ const pos = types.indexOf("object");
2419
+ if (pos !== -1) {
2420
+ types.slice(pos, 1);
2421
+ instances.push("Object");
2422
+ }
2423
+ }
2424
+ if (types.length > 0) {
2425
+ message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(
2426
+ types,
2427
+ "or"
2428
+ )}`;
2429
+ if (instances.length > 0 || other.length > 0) message += " or ";
2430
+ }
2431
+ if (instances.length > 0) {
2432
+ message += `an instance of ${formatList(instances, "or")}`;
2433
+ if (other.length > 0) message += " or ";
2434
+ }
2435
+ if (other.length > 0) {
2436
+ if (other.length > 1) {
2437
+ message += `one of ${formatList(other, "or")}`;
2438
+ } else {
2439
+ if (other[0]?.toLowerCase() !== other[0]) message += "an ";
2440
+ message += `${other[0]}`;
2441
+ }
2442
+ }
2443
+ message += `. Received ${determineSpecificType(actual)}`;
2444
+ return message;
2445
+ },
2446
+ TypeError
2447
+ );
2448
+ var ERR_INVALID_MODULE_SPECIFIER = createError(
2449
+ "ERR_INVALID_MODULE_SPECIFIER",
2450
+ /**
2451
+ * @param {string} request
2452
+ * @param {string} reason
2453
+ * @param {string} [base]
2454
+ */
2455
+ (request, reason, base) => {
2456
+ return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
2457
+ },
2458
+ TypeError
2459
+ );
2460
+ var ERR_INVALID_PACKAGE_CONFIG = createError(
2461
+ "ERR_INVALID_PACKAGE_CONFIG",
2462
+ (path3, base, message) => {
2463
+ return `Invalid package config ${path3}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
2464
+ },
2465
+ Error
2466
+ );
2467
+ var ERR_INVALID_PACKAGE_TARGET = createError(
2468
+ "ERR_INVALID_PACKAGE_TARGET",
2469
+ (packagePath, key, target, isImport = false, base) => {
2470
+ const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
2471
+ if (key === ".") {
2472
+ assert(isImport === false);
2473
+ return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
2474
+ }
2475
+ return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
2476
+ target
2477
+ )} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
2478
+ },
2479
+ Error
2480
+ );
2481
+ var ERR_MODULE_NOT_FOUND = createError(
2482
+ "ERR_MODULE_NOT_FOUND",
2483
+ (path3, base, exactUrl = false) => {
2484
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path3}' imported from ${base}`;
2485
+ },
2486
+ Error
2487
+ );
2488
+ createError(
2489
+ "ERR_NETWORK_IMPORT_DISALLOWED",
2490
+ "import of '%s' by %s is not supported: %s",
2491
+ Error
2492
+ );
2493
+ var ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
2494
+ "ERR_PACKAGE_IMPORT_NOT_DEFINED",
2495
+ (specifier, packagePath, base) => {
2496
+ return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
2497
+ },
2498
+ TypeError
2499
+ );
2500
+ var ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
2501
+ "ERR_PACKAGE_PATH_NOT_EXPORTED",
2502
+ /**
2503
+ * @param {string} packagePath
2504
+ * @param {string} subpath
2505
+ * @param {string} [base]
2506
+ */
2507
+ (packagePath, subpath, base) => {
2508
+ if (subpath === ".")
2509
+ return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
2510
+ return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
2511
+ },
2512
+ Error
2513
+ );
2514
+ var ERR_UNSUPPORTED_DIR_IMPORT = createError(
2515
+ "ERR_UNSUPPORTED_DIR_IMPORT",
2516
+ "Directory import '%s' is not supported resolving ES modules imported from %s",
2517
+ Error
2518
+ );
2519
+ var ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
2520
+ "ERR_UNSUPPORTED_RESOLVE_REQUEST",
2521
+ 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
2522
+ TypeError
2523
+ );
2524
+ var ERR_UNKNOWN_FILE_EXTENSION = createError(
2525
+ "ERR_UNKNOWN_FILE_EXTENSION",
2526
+ (extension, path3) => {
2527
+ return `Unknown file extension "${extension}" for ${path3}`;
2528
+ },
2529
+ TypeError
2530
+ );
2531
+ createError(
2532
+ "ERR_INVALID_ARG_VALUE",
2533
+ (name, value, reason = "is invalid") => {
2534
+ let inspected = inspect(value);
2535
+ if (inspected.length > 128) {
2536
+ inspected = `${inspected.slice(0, 128)}...`;
2537
+ }
2538
+ const type = name.includes(".") ? "property" : "argument";
2539
+ return `The ${type} '${name}' ${reason}. Received ${inspected}`;
2540
+ },
2541
+ TypeError
2542
+ // Note: extra classes have been shaken out.
2543
+ // , RangeError
2544
+ );
2545
+ var hasOwnProperty$1 = {}.hasOwnProperty;
2546
+ var hasOwnProperty = {}.hasOwnProperty;
2547
+ var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
2548
+ var own = {}.hasOwnProperty;
2549
+ var isWindows = (() => process.platform === "win32")();
2550
+ var globalCache = (() => (
2551
+ // eslint-disable-next-line unicorn/no-unreadable-iife
2552
+ globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map()
2553
+ ))();
2554
+
2555
+ // ../../core/src/shared/utils/module.ts
2246
2556
  var importMetaResolve = /* @__PURE__ */ __name((...args) => {
2247
2557
  if (typeof import.meta.resolve !== "function" && process.env.VITEST === "true") {
2248
2558
  console.warn(
package/dist/manager.js CHANGED
@@ -702,13 +702,16 @@ var TestProviderRender = /* @__PURE__ */ __name(({
702
702
  {
703
703
  "aria-label": "Start test run",
704
704
  size: "medium",
705
- onClick: () => store.send({
706
- type: "TRIGGER_RUN",
707
- payload: {
708
- storyIds: entry ? api.findAllLeafStoryIds(entry.id) : void 0,
709
- triggeredBy: entry ? entry.type : "global"
705
+ onClick: () => {
706
+ let storyIds;
707
+ if (entry) {
708
+ storyIds = entry.type === "story" ? [entry.id] : api.findAllLeafStoryIds(entry.id);
710
709
  }
711
- })
710
+ store.send({
711
+ type: "TRIGGER_RUN",
712
+ payload: { storyIds, triggeredBy: entry?.type ?? "global" }
713
+ });
714
+ }
712
715
  },
713
716
  React3.createElement(PlayHollowIcon, null)
714
717
  )
@@ -1,23 +1,23 @@
1
- import CJS_COMPAT_NODE_URL_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.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-PAVNRHXA.js";
14
+ } from "../_node-chunks/chunk-UYVAFZJ5.js";
15
15
  import {
16
16
  __commonJS,
17
17
  __name,
18
18
  __require,
19
19
  __toESM
20
- } from "../_node-chunks/chunk-W34P2AWY.js";
20
+ } from "../_node-chunks/chunk-JCPCXLQR.js";
21
21
 
22
22
  // ../../node_modules/istanbul-lib-report/node_modules/make-dir/index.js
23
23
  var require_make_dir = __commonJS({
@@ -1,38 +1,38 @@
1
- import CJS_COMPAT_NODE_URL_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.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-4ODWEZZ6.js";
14
+ } from "../_node-chunks/chunk-7CWQZZOM.js";
15
15
  import {
16
16
  any,
17
17
  errorToErrorLike
18
- } from "../_node-chunks/chunk-GUHYTLWS.js";
18
+ } from "../_node-chunks/chunk-3ZBK44FT.js";
19
19
  import {
20
20
  ADDON_ID,
21
21
  COVERAGE_DIRECTORY,
22
22
  STATUS_TYPE_ID_A11Y,
23
23
  STATUS_TYPE_ID_COMPONENT_TEST,
24
24
  storeOptions
25
- } from "../_node-chunks/chunk-GGPSQDLA.js";
26
- import "../_node-chunks/chunk-NUDB275Q.js";
25
+ } from "../_node-chunks/chunk-2I6HEIHF.js";
26
+ import "../_node-chunks/chunk-VQZJG5ES.js";
27
27
  import {
28
28
  dirname,
29
29
  join,
30
30
  normalize,
31
31
  path
32
- } from "../_node-chunks/chunk-ZOV2V4R2.js";
32
+ } from "../_node-chunks/chunk-BQNZ4G5P.js";
33
33
  import {
34
34
  __name
35
- } from "../_node-chunks/chunk-W34P2AWY.js";
35
+ } from "../_node-chunks/chunk-JCPCXLQR.js";
36
36
 
37
37
  // src/node/vitest.ts
38
38
  import process2 from "node:process";
@@ -242,6 +242,8 @@ var StorybookReporter = class {
242
242
  var VITEST_CONFIG_FILE_EXTENSIONS = ["mts", "mjs", "cts", "cjs", "ts", "tsx", "js", "jsx"];
243
243
  var VITEST_WORKSPACE_FILE_EXTENSION = ["ts", "js", "json"];
244
244
  process.env.VITEST_STORYBOOK = "true";
245
+ var DOUBLE_SPACES = " ";
246
+ var getTestName = /* @__PURE__ */ __name((name) => `${name}${DOUBLE_SPACES}`, "getTestName");
245
247
  var VitestManager = class {
246
248
  constructor(testManager) {
247
249
  this.testManager = testManager;
@@ -432,16 +434,36 @@ Please install the @vitest/${coveragePackage} package to collect coverage
432
434
  this.resetGlobalTestNamePattern();
433
435
  await this.cancelCurrentRun();
434
436
  const testSpecifications = await this.getStorybookTestSpecifications();
435
- const stories = await this.fetchStories(runPayload?.storyIds);
437
+ const allStories = await this.fetchStories();
438
+ const filteredStories = runPayload.storyIds ? allStories.filter((story) => runPayload.storyIds?.includes(story.id)) : allStories;
436
439
  const isSingleStoryRun = runPayload.storyIds?.length === 1;
437
440
  if (isSingleStoryRun) {
438
- const storyName = stories[0].name;
439
- const regex = new RegExp(`^${storyName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}$`);
441
+ const selectedStory = filteredStories.find((story) => story.id === runPayload.storyIds?.[0]);
442
+ if (!selectedStory) {
443
+ throw new Error(`Story ${runPayload.storyIds?.[0]} not found`);
444
+ }
445
+ const storyName = selectedStory.name;
446
+ let regex;
447
+ const isParentStory = allStories.some((story) => selectedStory.id === story.parent);
448
+ const hasParentStory = allStories.some((story) => selectedStory.parent === story.id);
449
+ if (isParentStory) {
450
+ const parentName = getTestName(selectedStory.name);
451
+ regex = new RegExp(`^${parentName}`);
452
+ } else if (hasParentStory) {
453
+ const parentStory = allStories.find((story) => story.id === selectedStory.parent);
454
+ if (!parentStory) {
455
+ throw new Error(`Parent story not found for story ${selectedStory.id}`);
456
+ }
457
+ const parentName = getTestName(parentStory.name);
458
+ regex = new RegExp(`^${parentName} ${storyName}$`);
459
+ } else {
460
+ regex = new RegExp(`^${storyName}$`);
461
+ }
440
462
  this.vitest.setGlobalTestNamePattern(regex);
441
463
  }
442
464
  const { filteredTestSpecifications, filteredStoryIds } = this.filterTestSpecifications(
443
465
  testSpecifications,
444
- stories
466
+ filteredStories
445
467
  );
446
468
  this.testManager.store.setState((s) => ({
447
469
  ...s,
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,22 +12,22 @@ var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
12
12
  import {
13
13
  execa,
14
14
  resolvePackageDir
15
- } from "./_node-chunks/chunk-OTJIME4I.js";
15
+ } from "./_node-chunks/chunk-YS3356RQ.js";
16
16
  import {
17
17
  any,
18
18
  getAddonNames,
19
19
  up
20
- } from "./_node-chunks/chunk-GUHYTLWS.js";
20
+ } from "./_node-chunks/chunk-3ZBK44FT.js";
21
21
  import {
22
22
  DOCUMENTATION_LINK,
23
23
  SUPPORTED_FRAMEWORKS
24
- } from "./_node-chunks/chunk-GGPSQDLA.js";
24
+ } from "./_node-chunks/chunk-2I6HEIHF.js";
25
25
  import {
26
26
  dirname,
27
27
  join,
28
28
  relative,
29
29
  resolve
30
- } from "./_node-chunks/chunk-ZOV2V4R2.js";
30
+ } from "./_node-chunks/chunk-BQNZ4G5P.js";
31
31
  import {
32
32
  require_compare,
33
33
  require_constants,
@@ -37,12 +37,12 @@ import {
37
37
  require_parse_options,
38
38
  require_re,
39
39
  require_semver
40
- } from "./_node-chunks/chunk-PAVNRHXA.js";
40
+ } from "./_node-chunks/chunk-UYVAFZJ5.js";
41
41
  import {
42
42
  __commonJS,
43
43
  __name,
44
44
  __toESM
45
- } from "./_node-chunks/chunk-W34P2AWY.js";
45
+ } from "./_node-chunks/chunk-JCPCXLQR.js";
46
46
 
47
47
  // ../../node_modules/semver/functions/parse.js
48
48
  var require_parse = __commonJS({
package/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,11 +12,11 @@ var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
12
12
  import {
13
13
  log,
14
14
  noop
15
- } from "./_node-chunks/chunk-4ODWEZZ6.js";
15
+ } from "./_node-chunks/chunk-7CWQZZOM.js";
16
16
  import {
17
17
  execaNode,
18
18
  importMetaResolve
19
- } from "./_node-chunks/chunk-OTJIME4I.js";
19
+ } from "./_node-chunks/chunk-YS3356RQ.js";
20
20
  import {
21
21
  ADDON_ID,
22
22
  COVERAGE_DIRECTORY,
@@ -25,17 +25,17 @@ import {
25
25
  STORYBOOK_ADDON_TEST_CHANNEL,
26
26
  TEST_PROVIDER_STORE_CHANNEL_EVENT_NAME,
27
27
  storeOptions
28
- } from "./_node-chunks/chunk-GGPSQDLA.js";
28
+ } from "./_node-chunks/chunk-2I6HEIHF.js";
29
29
  import {
30
30
  require_picocolors
31
- } from "./_node-chunks/chunk-NUDB275Q.js";
31
+ } from "./_node-chunks/chunk-VQZJG5ES.js";
32
32
  import {
33
33
  normalize
34
- } from "./_node-chunks/chunk-ZOV2V4R2.js";
34
+ } from "./_node-chunks/chunk-BQNZ4G5P.js";
35
35
  import {
36
36
  __name,
37
37
  __toESM
38
- } from "./_node-chunks/chunk-W34P2AWY.js";
38
+ } from "./_node-chunks/chunk-JCPCXLQR.js";
39
39
 
40
40
  // src/preset.ts
41
41
  import { mkdir } from "node:fs/promises";
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.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-W34P2AWY.js";
17
+ } from "../_node-chunks/chunk-JCPCXLQR.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_z9ub594f67 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_z9ub594f67 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_z9ub594f67 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ufgbf04482g from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ufgbf04482g from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ufgbf04482g from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_z9ub594f67.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_z9ub594f67.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_z9ub594f67.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ufgbf04482g.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ufgbf04482g.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ufgbf04482g.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-NUDB275Q.js";
14
+ } from "../_node-chunks/chunk-VQZJG5ES.js";
15
15
  import {
16
16
  join,
17
17
  normalize,
18
18
  relative,
19
19
  resolve,
20
20
  sep
21
- } from "../_node-chunks/chunk-ZOV2V4R2.js";
21
+ } from "../_node-chunks/chunk-BQNZ4G5P.js";
22
22
  import {
23
23
  __commonJS,
24
24
  __name,
25
25
  __require,
26
26
  __toESM
27
- } from "../_node-chunks/chunk-W34P2AWY.js";
27
+ } from "../_node-chunks/chunk-JCPCXLQR.js";
28
28
 
29
29
  // ../../node_modules/braces/lib/utils.js
30
30
  var require_utils = __commonJS({
@@ -3592,7 +3592,8 @@ var storybookTest = /* @__PURE__ */ __name(async (options) => {
3592
3592
  staticDirs,
3593
3593
  previewLevelTags,
3594
3594
  core,
3595
- extraOptimizeDeps
3595
+ extraOptimizeDeps,
3596
+ features
3596
3597
  ] = await Promise.all([
3597
3598
  getStoryGlobsAndFiles(presets, directories),
3598
3599
  presets.apply("framework", void 0),
@@ -3601,7 +3602,8 @@ var storybookTest = /* @__PURE__ */ __name(async (options) => {
3601
3602
  presets.apply("staticDirs", []),
3602
3603
  extractTagsFromPreview(finalOptions.configDir),
3603
3604
  presets.apply("core"),
3604
- presets.apply("optimizeViteDeps", [])
3605
+ presets.apply("optimizeViteDeps", []),
3606
+ presets.apply("features", {})
3605
3607
  ]);
3606
3608
  const pluginsToIgnore = [
3607
3609
  "storybook:react-docgen-plugin",
@@ -3731,7 +3733,8 @@ var storybookTest = /* @__PURE__ */ __name(async (options) => {
3731
3733
  ]
3732
3734
  },
3733
3735
  define: {
3734
- ...frameworkName?.includes("vue3") ? { __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false" } : {}
3736
+ ...frameworkName?.includes("vue3") ? { __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false" } : {},
3737
+ FEATURES: JSON.stringify(features)
3735
3738
  }
3736
3739
  };
3737
3740
  const config = mergeConfig(
@@ -3,6 +3,7 @@ import {
3
3
  } from "../_browser-chunks/chunk-JK72E6FR.js";
4
4
 
5
5
  // src/vitest-plugin/test-utils.ts
6
+ import { getStoryChildren, isStory } from "storybook/internal/csf";
6
7
  import { server } from "@vitest/browser/context";
7
8
  import { composeStory, getCsfFactoryAnnotations } from "storybook/preview-api";
8
9
 
@@ -53,15 +54,15 @@ var setViewport = /* @__PURE__ */ __name(async (parameters = {}, globals = {}) =
53
54
  if (!page || !globalThis.__vitest_browser__) {
54
55
  return;
55
56
  }
56
- const viewports = {
57
+ const options = {
57
58
  ...MINIMAL_VIEWPORTS,
58
59
  ...viewportsParam.viewports,
59
60
  ...viewportsParam.options
60
61
  };
61
62
  let viewportWidth = DEFAULT_VIEWPORT_DIMENSIONS.width;
62
63
  let viewportHeight = DEFAULT_VIEWPORT_DIMENSIONS.height;
63
- if (defaultViewport && defaultViewport in viewports) {
64
- const styles = viewports[defaultViewport].styles;
64
+ if (defaultViewport && defaultViewport in options) {
65
+ const { styles } = options[defaultViewport];
65
66
  if (styles?.width && styles?.height) {
66
67
  const { width, height } = styles;
67
68
  viewportWidth = parseDimension(width, "width");
@@ -78,11 +79,13 @@ var convertToFilePath = /* @__PURE__ */ __name((url) => {
78
79
  const normalizedPath = path.replace(/^\/+([a-zA-Z]:)/, "$1");
79
80
  return normalizedPath.replace(/%20/g, " ");
80
81
  }, "convertToFilePath");
81
- var testStory = /* @__PURE__ */ __name((exportName, story, meta, skipTags) => {
82
+ var testStory = /* @__PURE__ */ __name((exportName, story, meta, skipTags, storyId, testName) => {
82
83
  return async (context) => {
83
84
  const annotations = getCsfFactoryAnnotations(story, meta);
85
+ const test = isStory(story) && testName ? getStoryChildren(story).find((child) => child.input.name === testName) : void 0;
86
+ const storyAnnotations = test ? test.input : annotations.story;
84
87
  const composedStory = composeStory(
85
- annotations.story,
88
+ storyAnnotations,
86
89
  annotations.meta,
87
90
  { initialGlobals: await getInitialGlobals?.() ?? {} },
88
91
  annotations.preview ?? globalThis.globalProjectAnnotations,
@@ -93,9 +96,9 @@ var testStory = /* @__PURE__ */ __name((exportName, story, meta, skipTags) => {
93
96
  }
94
97
  context.story = composedStory;
95
98
  const _task = context.task;
96
- _task.meta.storyId = composedStory.id;
99
+ _task.meta.storyId = storyId;
97
100
  await setViewport(composedStory.parameters, composedStory.globals);
98
- await composedStory.run();
101
+ await composedStory.run(void 0);
99
102
  _task.meta.reports = composedStory.reporting.reports;
100
103
  };
101
104
  }, "testStory");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-vitest",
3
- "version": "10.0.0-beta.6",
3
+ "version": "10.0.0-beta.8",
4
4
  "description": "Storybook Vitest addon: Blazing fast component testing using stories",
5
5
  "keywords": [
6
6
  "storybook",
@@ -106,7 +106,7 @@
106
106
  "peerDependencies": {
107
107
  "@vitest/browser": "^3.0.0",
108
108
  "@vitest/runner": "^3.0.0",
109
- "storybook": "^10.0.0-beta.6",
109
+ "storybook": "^10.0.0-beta.8",
110
110
  "vitest": "^3.0.0"
111
111
  },
112
112
  "peerDependenciesMeta": {