@storybook/addon-vitest 0.0.0-pr-33718-sha-6755af19 → 0.0.0-pr-33653-sha-f37b6acd
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.
- package/dist/_node-chunks/{chunk-CDFGL5GY.js → chunk-52N6MBQI.js} +7 -7
- package/dist/_node-chunks/{chunk-ZS2NYKWS.js → chunk-AT6FCHOS.js} +6 -6
- package/dist/_node-chunks/{chunk-R2I27JRI.js → chunk-ISOKYMWM.js} +6 -6
- package/dist/_node-chunks/{chunk-NHS6S7Y7.js → chunk-KGPI42BJ.js} +6 -6
- package/dist/_node-chunks/{chunk-SUCNZM55.js → chunk-SPSDZTLD.js} +7 -7
- package/dist/_node-chunks/{chunk-LJWCAUAC.js → chunk-VIWBU6AK.js} +6 -6
- package/dist/_node-chunks/{chunk-LKFL2M6A.js → chunk-XF2JI42F.js} +9 -9
- package/dist/_node-chunks/{chunk-MCV5F2O4.js → chunk-XOAXKHM3.js} +7 -7
- package/dist/_node-chunks/chunk-ZXTDSRMW.js +158 -0
- package/dist/node/coverage-reporter.js +8 -8
- package/dist/node/vitest.js +12 -12
- package/dist/postinstall.js +36 -48
- package/dist/preset.js +17 -148
- package/dist/vitest-plugin/global-setup.js +7 -7
- package/dist/vitest-plugin/index.js +10 -10
- package/package.json +2 -2
- package/dist/_node-chunks/vitest.config-SQO6JVJE.js +0 -53
- package/dist/_node-chunks/vitest.config.3.2-LFKKU736.js +0 -53
- package/dist/_node-chunks/vitest.config.4-CZE7W7DZ.js +0 -55
- package/dist/_node-chunks/vitest.workspace-Y2YDFY34.js +0 -50
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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-
|
|
14
|
+
} from "./chunk-KGPI42BJ.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/semver/internal/constants.js
|
|
17
17
|
var require_constants = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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-
|
|
14
|
+
} from "./chunk-KGPI42BJ.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/ts-dedent/dist/index.js
|
|
17
17
|
var require_dist = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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-
|
|
14
|
+
} from "./chunk-VIWBU6AK.js";
|
|
15
15
|
import {
|
|
16
16
|
require_picocolors
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-XOAXKHM3.js";
|
|
18
18
|
import {
|
|
19
19
|
__toESM
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KGPI42BJ.js";
|
|
21
21
|
|
|
22
22
|
// src/logger.ts
|
|
23
23
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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-
|
|
14
|
+
} from "./chunk-KGPI42BJ.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/picocolors/picocolors.js
|
|
17
17
|
var require_picocolors = __commonJS({
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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-AT6FCHOS.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
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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-
|
|
14
|
+
} from "../_node-chunks/chunk-52N6MBQI.js";
|
|
15
15
|
import {
|
|
16
16
|
__commonJS,
|
|
17
17
|
__require,
|
|
18
18
|
__toESM
|
|
19
|
-
} from "../_node-chunks/chunk-
|
|
19
|
+
} from "../_node-chunks/chunk-KGPI42BJ.js";
|
|
20
20
|
|
|
21
21
|
// ../../../node_modules/istanbul-lib-report/node_modules/make-dir/index.js
|
|
22
22
|
var require_make_dir = __commonJS({
|
package/dist/node/vitest.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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-
|
|
14
|
+
} from "../_node-chunks/chunk-XF2JI42F.js";
|
|
15
15
|
import {
|
|
16
16
|
any
|
|
17
|
-
} from "../_node-chunks/chunk-
|
|
17
|
+
} from "../_node-chunks/chunk-ISOKYMWM.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-
|
|
25
|
-
import "../_node-chunks/chunk-
|
|
24
|
+
} from "../_node-chunks/chunk-VIWBU6AK.js";
|
|
25
|
+
import "../_node-chunks/chunk-XOAXKHM3.js";
|
|
26
26
|
import {
|
|
27
27
|
dirname,
|
|
28
28
|
join,
|
|
29
29
|
normalize,
|
|
30
30
|
path
|
|
31
|
-
} from "../_node-chunks/chunk-
|
|
32
|
-
import "../_node-chunks/chunk-
|
|
31
|
+
} from "../_node-chunks/chunk-AT6FCHOS.js";
|
|
32
|
+
import "../_node-chunks/chunk-KGPI42BJ.js";
|
|
33
33
|
|
|
34
34
|
// src/node/vitest.ts
|
|
35
35
|
import process2 from "node:process";
|
package/dist/postinstall.js
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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-ZXTDSRMW.js";
|
|
12
15
|
import {
|
|
13
16
|
any
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
17
|
+
} from "./_node-chunks/chunk-ISOKYMWM.js";
|
|
15
18
|
import {
|
|
16
19
|
DOCUMENTATION_LINK
|
|
17
|
-
} from "./_node-chunks/chunk-
|
|
20
|
+
} from "./_node-chunks/chunk-VIWBU6AK.js";
|
|
18
21
|
import {
|
|
19
22
|
require_dist
|
|
20
|
-
} from "./_node-chunks/chunk-
|
|
23
|
+
} from "./_node-chunks/chunk-SPSDZTLD.js";
|
|
21
24
|
import {
|
|
22
25
|
dirname,
|
|
26
|
+
join,
|
|
23
27
|
normalize,
|
|
24
28
|
relative,
|
|
25
29
|
resolve
|
|
26
|
-
} from "./_node-chunks/chunk-
|
|
30
|
+
} from "./_node-chunks/chunk-AT6FCHOS.js";
|
|
27
31
|
import {
|
|
28
32
|
require_compare,
|
|
29
33
|
require_constants,
|
|
@@ -33,11 +37,11 @@ import {
|
|
|
33
37
|
require_parse_options,
|
|
34
38
|
require_re,
|
|
35
39
|
require_semver
|
|
36
|
-
} from "./_node-chunks/chunk-
|
|
40
|
+
} from "./_node-chunks/chunk-52N6MBQI.js";
|
|
37
41
|
import {
|
|
38
42
|
__commonJS,
|
|
39
43
|
__toESM
|
|
40
|
-
} from "./_node-chunks/chunk-
|
|
44
|
+
} from "./_node-chunks/chunk-KGPI42BJ.js";
|
|
41
45
|
|
|
42
46
|
// ../../../node_modules/semver/functions/parse.js
|
|
43
47
|
var require_parse = __commonJS({
|
|
@@ -558,14 +562,14 @@ var require_to_comparators = __commonJS({
|
|
|
558
562
|
var require_max_satisfying = __commonJS({
|
|
559
563
|
"../../../node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
560
564
|
"use strict";
|
|
561
|
-
var SemVer = require_semver(), Range = require_range(), maxSatisfying = (
|
|
565
|
+
var SemVer = require_semver(), Range = require_range(), maxSatisfying = (versions, range, options) => {
|
|
562
566
|
let max = null, maxSV = null, rangeObj = null;
|
|
563
567
|
try {
|
|
564
568
|
rangeObj = new Range(range, options);
|
|
565
569
|
} catch {
|
|
566
570
|
return null;
|
|
567
571
|
}
|
|
568
|
-
return
|
|
572
|
+
return versions.forEach((v) => {
|
|
569
573
|
rangeObj.test(v) && (!max || maxSV.compare(v) === -1) && (max = v, maxSV = new SemVer(max, options));
|
|
570
574
|
}), max;
|
|
571
575
|
};
|
|
@@ -577,14 +581,14 @@ var require_max_satisfying = __commonJS({
|
|
|
577
581
|
var require_min_satisfying = __commonJS({
|
|
578
582
|
"../../../node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
579
583
|
"use strict";
|
|
580
|
-
var SemVer = require_semver(), Range = require_range(), minSatisfying = (
|
|
584
|
+
var SemVer = require_semver(), Range = require_range(), minSatisfying = (versions, range, options) => {
|
|
581
585
|
let min = null, minSV = null, rangeObj = null;
|
|
582
586
|
try {
|
|
583
587
|
rangeObj = new Range(range, options);
|
|
584
588
|
} catch {
|
|
585
589
|
return null;
|
|
586
590
|
}
|
|
587
|
-
return
|
|
591
|
+
return versions.forEach((v) => {
|
|
588
592
|
rangeObj.test(v) && (!min || minSV.compare(v) === 1) && (min = v, minSV = new SemVer(min, options));
|
|
589
593
|
}), min;
|
|
590
594
|
};
|
|
@@ -710,8 +714,8 @@ var require_simplify = __commonJS({
|
|
|
710
714
|
"../../../node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
711
715
|
"use strict";
|
|
712
716
|
var satisfies2 = require_satisfies(), compare = require_compare();
|
|
713
|
-
module.exports = (
|
|
714
|
-
let set = [], first = null, prev = null, v =
|
|
717
|
+
module.exports = (versions, range, options) => {
|
|
718
|
+
let set = [], first = null, prev = null, v = versions.sort((a, b) => compare(a, b, options));
|
|
715
719
|
for (let version of v)
|
|
716
720
|
satisfies2(version, range, options) ? (prev = version, first || (first = version)) : (prev && set.push([first, prev]), prev = null, first = null);
|
|
717
721
|
first && set.push([first, null]);
|
|
@@ -869,7 +873,7 @@ var require_semver2 = __commonJS({
|
|
|
869
873
|
|
|
870
874
|
// src/postinstall.ts
|
|
871
875
|
import { existsSync } from "node:fs";
|
|
872
|
-
import * as
|
|
876
|
+
import * as fs2 from "node:fs/promises";
|
|
873
877
|
import { writeFile } from "node:fs/promises";
|
|
874
878
|
import { babelParse, generate, traverse } from "storybook/internal/babel";
|
|
875
879
|
import { AddonVitestService } from "storybook/internal/cli";
|
|
@@ -877,8 +881,7 @@ import {
|
|
|
877
881
|
JsPackageManagerFactory,
|
|
878
882
|
formatFileContent,
|
|
879
883
|
getProjectRoot,
|
|
880
|
-
getStorybookInfo
|
|
881
|
-
versions
|
|
884
|
+
getStorybookInfo
|
|
882
885
|
} from "storybook/internal/common";
|
|
883
886
|
import { CLI_COLORS } from "storybook/internal/node-logger";
|
|
884
887
|
import {
|
|
@@ -892,22 +895,12 @@ import { SupportedFramework } from "storybook/internal/types";
|
|
|
892
895
|
var import_semver = __toESM(require_semver2(), 1), import_ts_dedent = __toESM(require_dist(), 1);
|
|
893
896
|
|
|
894
897
|
// src/updateVitestFile.ts
|
|
895
|
-
|
|
896
|
-
switch (name) {
|
|
897
|
-
case "vitest.config.template":
|
|
898
|
-
return import("./_node-chunks/vitest.config-SQO6JVJE.js");
|
|
899
|
-
case "vitest.config.4.template":
|
|
900
|
-
return import("./_node-chunks/vitest.config.4-CZE7W7DZ.js");
|
|
901
|
-
case "vitest.config.3.2.template":
|
|
902
|
-
return import("./_node-chunks/vitest.config.3.2-LFKKU736.js");
|
|
903
|
-
case "vitest.workspace.template":
|
|
904
|
-
return import("./_node-chunks/vitest.workspace-Y2YDFY34.js");
|
|
905
|
-
default:
|
|
906
|
-
throw new Error(`Unknown template: ${name}`);
|
|
907
|
-
}
|
|
908
|
-
}
|
|
898
|
+
import * as fs from "node:fs/promises";
|
|
909
899
|
var loadTemplate = async (name, replacements) => {
|
|
910
|
-
let template =
|
|
900
|
+
let template = await fs.readFile(
|
|
901
|
+
join(resolvePackageDir("@storybook/addon-vitest"), "templates", name),
|
|
902
|
+
"utf8"
|
|
903
|
+
);
|
|
911
904
|
return Object.entries(replacements).forEach(
|
|
912
905
|
([key, value]) => template = template.replace(key, normalize(value))
|
|
913
906
|
), template;
|
|
@@ -1123,8 +1116,7 @@ async function postInstall(options) {
|
|
|
1123
1116
|
Playwright browser binaries installation skipped. Please run the following command manually later:
|
|
1124
1117
|
${CLI_COLORS.cta("npx playwright install chromium --with-deps")}
|
|
1125
1118
|
`) : await addonVitestService.installPlaywright({
|
|
1126
|
-
yes: options.yes
|
|
1127
|
-
useRemotePkg: !!options.skipInstall
|
|
1119
|
+
yes: options.yes
|
|
1128
1120
|
}));
|
|
1129
1121
|
let fileExtension = allDeps.typescript || findFile("tsconfig", [...EXTENSIONS, ".json"]) ? "ts" : "js", vitestSetupFile = resolve(options.configDir, `vitest.setup.${fileExtension}`), existingSetupFile = EXTENSIONS.map((ext) => resolve(options.configDir, `vitest.setup${ext}`)).find(existsSync) || null;
|
|
1130
1122
|
if (existingSetupFile)
|
|
@@ -1153,16 +1145,16 @@ async function postInstall(options) {
|
|
|
1153
1145
|
"vitest.shims.d.ts",
|
|
1154
1146
|
isVitest4OrNewer ? '/// <reference types="@vitest/browser-playwright" />' : '/// <reference types="@vitest/browser/providers/playwright" />'
|
|
1155
1147
|
);
|
|
1156
|
-
let getTemplateName = () => isVitest4OrNewer ? "vitest.config.4.template" : isVitest3_2To4 ? "vitest.config.3.2.template" : "vitest.config.template";
|
|
1148
|
+
let getTemplateName = () => isVitest4OrNewer ? "vitest.config.4.template.ts" : isVitest3_2To4 ? "vitest.config.3.2.template.ts" : "vitest.config.template.ts";
|
|
1157
1149
|
if (vitestWorkspaceFile) {
|
|
1158
|
-
let workspaceFileContent = await
|
|
1150
|
+
let workspaceFileContent = await fs2.readFile(vitestWorkspaceFile, "utf8");
|
|
1159
1151
|
if (isConfigAlreadySetup(vitestWorkspaceFile, workspaceFileContent)) {
|
|
1160
1152
|
logger.step(
|
|
1161
1153
|
CLI_COLORS.success("Vitest for Storybook is already properly configured. Skipping setup.")
|
|
1162
1154
|
);
|
|
1163
1155
|
return;
|
|
1164
1156
|
}
|
|
1165
|
-
let workspaceTemplate = await loadTemplate("vitest.workspace.template", {
|
|
1157
|
+
let workspaceTemplate = await loadTemplate("vitest.workspace.template.ts", {
|
|
1166
1158
|
EXTENDS_WORKSPACE: viteConfigFile ? relative(dirname(vitestWorkspaceFile), viteConfigFile) : "",
|
|
1167
1159
|
CONFIG_DIR: options.configDir,
|
|
1168
1160
|
SETUP_FILE: relative(dirname(vitestWorkspaceFile), existingSetupFile ?? vitestSetupFile)
|
|
@@ -1188,7 +1180,7 @@ async function postInstall(options) {
|
|
|
1188
1180
|
new AddonVitestPostinstallWorkspaceUpdateError({ filePath: vitestWorkspaceFile })
|
|
1189
1181
|
);
|
|
1190
1182
|
} else if (rootConfig) {
|
|
1191
|
-
let target, updated, configFile = await
|
|
1183
|
+
let target, updated, configFile = await fs2.readFile(rootConfig, "utf8"), configFileHasTypeReference = configFile.match(
|
|
1192
1184
|
/\/\/\/\s*<reference\s+types=["']vitest\/config["']\s*\/>/
|
|
1193
1185
|
), templateName = getTemplateName(), alreadyConfigured = isConfigAlreadySetup(rootConfig, configFile);
|
|
1194
1186
|
if (templateName && !alreadyConfigured) {
|
|
@@ -1229,7 +1221,7 @@ async function postInstall(options) {
|
|
|
1229
1221
|
if (info.addons.find((addon) => addon.includes(addonA11yName)))
|
|
1230
1222
|
try {
|
|
1231
1223
|
let command = [
|
|
1232
|
-
|
|
1224
|
+
"storybook",
|
|
1233
1225
|
"automigrate",
|
|
1234
1226
|
"addon-a11y-addon-test",
|
|
1235
1227
|
"--loglevel",
|
|
@@ -1239,11 +1231,7 @@ async function postInstall(options) {
|
|
|
1239
1231
|
];
|
|
1240
1232
|
options.packageManager && command.push("--package-manager", options.packageManager), options.skipInstall && command.push("--skip-install"), options.configDir !== ".storybook" && command.push("--config-dir", options.configDir), await prompt.executeTask(
|
|
1241
1233
|
// TODO: Remove stdio: 'ignore' once we have a way to log the output of the command properly
|
|
1242
|
-
() => packageManager.runPackageCommand({
|
|
1243
|
-
args: command,
|
|
1244
|
-
stdio: "ignore",
|
|
1245
|
-
useRemotePkg: !!options.skipInstall
|
|
1246
|
-
}),
|
|
1234
|
+
() => packageManager.runPackageCommand({ args: command, stdio: "ignore" }),
|
|
1247
1235
|
{
|
|
1248
1236
|
intro: "Setting up a11y addon for @storybook/addon-vitest",
|
|
1249
1237
|
error: "Failed to setup a11y addon for @storybook/addon-vitest",
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,7 +12,10 @@ var require = CJS_COMPAT_NODE_MODULE_s2225k69d2.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
log,
|
|
14
14
|
noop
|
|
15
|
-
} from "./_node-chunks/chunk-
|
|
15
|
+
} from "./_node-chunks/chunk-XF2JI42F.js";
|
|
16
|
+
import {
|
|
17
|
+
importMetaResolve
|
|
18
|
+
} from "./_node-chunks/chunk-ZXTDSRMW.js";
|
|
16
19
|
import {
|
|
17
20
|
ADDON_ID,
|
|
18
21
|
COVERAGE_DIRECTORY,
|
|
@@ -21,19 +24,19 @@ import {
|
|
|
21
24
|
STORYBOOK_ADDON_TEST_CHANNEL,
|
|
22
25
|
TEST_PROVIDER_STORE_CHANNEL_EVENT_NAME,
|
|
23
26
|
storeOptions
|
|
24
|
-
} from "./_node-chunks/chunk-
|
|
27
|
+
} from "./_node-chunks/chunk-VIWBU6AK.js";
|
|
25
28
|
import {
|
|
26
29
|
require_picocolors
|
|
27
|
-
} from "./_node-chunks/chunk-
|
|
30
|
+
} from "./_node-chunks/chunk-XOAXKHM3.js";
|
|
28
31
|
import {
|
|
29
32
|
require_dist
|
|
30
|
-
} from "./_node-chunks/chunk-
|
|
33
|
+
} from "./_node-chunks/chunk-SPSDZTLD.js";
|
|
31
34
|
import {
|
|
32
35
|
normalize
|
|
33
|
-
} from "./_node-chunks/chunk-
|
|
36
|
+
} from "./_node-chunks/chunk-AT6FCHOS.js";
|
|
34
37
|
import {
|
|
35
38
|
__toESM
|
|
36
|
-
} from "./_node-chunks/chunk-
|
|
39
|
+
} from "./_node-chunks/chunk-KGPI42BJ.js";
|
|
37
40
|
|
|
38
41
|
// src/preset.ts
|
|
39
42
|
import { mkdir } from "node:fs/promises";
|
|
@@ -207,147 +210,13 @@ function isEqual(a, b) {
|
|
|
207
210
|
var import_picocolors = __toESM(require_picocolors(), 1), import_ts_dedent = __toESM(require_dist(), 1);
|
|
208
211
|
|
|
209
212
|
// src/node/boot-test-runner.ts
|
|
210
|
-
import { fileURLToPath
|
|
213
|
+
import { fileURLToPath } from "node:url";
|
|
211
214
|
import { executeNodeCommand } from "storybook/internal/common";
|
|
212
215
|
import {
|
|
213
216
|
internal_universalStatusStore,
|
|
214
217
|
internal_universalTestProviderStore
|
|
215
218
|
} from "storybook/internal/core-server";
|
|
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) => {
|
|
219
|
+
var MAX_START_TIME = 3e4, vitestModulePath = fileURLToPath(importMetaResolve("@storybook/addon-vitest/vitest")), eventQueue = [], child, ready = !1, unsubscribeStore, unsubscribeStatusStore, unsubscribeTestProviderStore, forwardUniversalStoreEvent = (storeEventName) => (event, eventInfo) => {
|
|
351
220
|
child?.send({
|
|
352
221
|
type: storeEventName,
|
|
353
222
|
args: [{ event, eventInfo }],
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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-
|
|
16
|
+
} from "../_node-chunks/chunk-KGPI42BJ.js";
|
|
17
17
|
|
|
18
18
|
// ../../../node_modules/tree-kill/index.js
|
|
19
19
|
var require_tree_kill = __commonJS({
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h71ypyyyy7o from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h71ypyyyy7o from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h71ypyyyy7o from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h71ypyyyy7o.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h71ypyyyy7o.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h71ypyyyy7o.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-
|
|
14
|
+
} from "../_node-chunks/chunk-XOAXKHM3.js";
|
|
15
15
|
import {
|
|
16
16
|
require_dist
|
|
17
|
-
} from "../_node-chunks/chunk-
|
|
17
|
+
} from "../_node-chunks/chunk-SPSDZTLD.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-
|
|
25
|
+
} from "../_node-chunks/chunk-AT6FCHOS.js";
|
|
26
26
|
import {
|
|
27
27
|
__commonJS,
|
|
28
28
|
__require,
|
|
29
29
|
__toESM
|
|
30
|
-
} from "../_node-chunks/chunk-
|
|
30
|
+
} from "../_node-chunks/chunk-KGPI42BJ.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-
|
|
3
|
+
"version": "0.0.0-pr-33653-sha-f37b6acd",
|
|
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-
|
|
102
|
+
"storybook": "^0.0.0-pr-33653-sha-f37b6acd",
|
|
103
103
|
"vitest": "^3.0.0 || ^4.0.0"
|
|
104
104
|
},
|
|
105
105
|
"peerDependenciesMeta": {
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_s2225k69d2 from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_s2225k69d2 from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_s2225k69d2 from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_s2225k69d2.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_s2225k69d2.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_s2225k69d2.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-NHS6S7Y7.js";
|
|
13
|
-
|
|
14
|
-
// raw:../templates/vitest.config.template
|
|
15
|
-
var vitest_config_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_default as default
|
|
53
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_s2225k69d2 from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_s2225k69d2 from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_s2225k69d2 from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_s2225k69d2.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_s2225k69d2.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_s2225k69d2.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-NHS6S7Y7.js";
|
|
13
|
-
|
|
14
|
-
// raw:../templates/vitest.config.3.2.template
|
|
15
|
-
var vitest_config_3_2_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_default as default
|
|
53
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_s2225k69d2 from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_s2225k69d2 from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_s2225k69d2 from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_s2225k69d2.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_s2225k69d2.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_s2225k69d2.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-NHS6S7Y7.js";
|
|
13
|
-
|
|
14
|
-
// raw:../templates/vitest.config.4.template
|
|
15
|
-
var vitest_config_4_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_default as default
|
|
55
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_s2225k69d2 from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_s2225k69d2 from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_s2225k69d2 from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_s2225k69d2.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_s2225k69d2.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_s2225k69d2.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-NHS6S7Y7.js";
|
|
13
|
-
|
|
14
|
-
// raw:../templates/vitest.workspace.template
|
|
15
|
-
var vitest_workspace_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_default as default
|
|
50
|
-
};
|