@storybook/addon-vitest 11.0.0-alpha.6 → 11.0.0-alpha.7
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-2YKI7DW2.js → chunk-6CLSAVWJ.js} +9 -9
- package/dist/_node-chunks/{chunk-5D6KK45I.js → chunk-AF2YLJ2G.js} +7 -7
- package/dist/_node-chunks/{chunk-BQV6NIJ6.js → chunk-I4KLCFNQ.js} +6 -6
- package/dist/_node-chunks/{chunk-PVSSJVWV.js → chunk-P3WCWO47.js} +7 -7
- package/dist/_node-chunks/{chunk-GHJVOTQS.js → chunk-R32VM5JX.js} +6 -6
- package/dist/_node-chunks/{chunk-5GHDCRJY.js → chunk-UNH5GLWY.js} +7 -7
- package/dist/_node-chunks/{chunk-CBTDG3NS.js → chunk-ZBTRLSUY.js} +6 -6
- package/dist/_node-chunks/{chunk-2KCBNFEY.js → chunk-ZGV2ODKH.js} +6 -6
- package/dist/_node-chunks/{vitest.config.4.template-YC3ONBFK.js → vitest.config.4.template-MHVHJLPK.js} +7 -7
- package/dist/constants.js +8 -8
- package/dist/node/coverage-reporter.js +12 -12
- package/dist/node/vitest.js +31 -24
- package/dist/postinstall.js +12 -12
- package/dist/preset.js +86 -27
- package/dist/vitest-plugin/global-setup.js +7 -7
- package/dist/vitest-plugin/index.js +17 -16
- package/dist/vitest-plugin/test-utils.js +8 -1
- package/package.json +4 -4
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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 "./chunk-
|
|
14
|
+
} from "./chunk-AF2YLJ2G.js";
|
|
15
15
|
import {
|
|
16
16
|
ADDON_ID2 as ADDON_ID
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZGV2ODKH.js";
|
|
18
18
|
import {
|
|
19
19
|
__toESM
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-I4KLCFNQ.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_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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-I4KLCFNQ.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/picocolors/picocolors.js
|
|
17
17
|
var require_picocolors = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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-I4KLCFNQ.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_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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-I4KLCFNQ.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_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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 "./chunk-
|
|
12
|
+
import "./chunk-I4KLCFNQ.js";
|
|
13
13
|
|
|
14
14
|
// raw:../templates/vitest.config.4.template.ts
|
|
15
15
|
var vitest_config_4_template_default = `import path from 'node:path';
|
package/dist/constants.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -35,8 +35,8 @@ import {
|
|
|
35
35
|
TRIGGER_TEST_RUN_RESPONSE,
|
|
36
36
|
TUTORIAL_VIDEO_LINK,
|
|
37
37
|
storeOptions
|
|
38
|
-
} from "./_node-chunks/chunk-
|
|
39
|
-
import "./_node-chunks/chunk-
|
|
38
|
+
} from "./_node-chunks/chunk-ZGV2ODKH.js";
|
|
39
|
+
import "./_node-chunks/chunk-I4KLCFNQ.js";
|
|
40
40
|
export {
|
|
41
41
|
ADDON_ID as A11Y_ADDON_ID,
|
|
42
42
|
PANEL_ID2 as A11Y_PANEL_ID,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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-UNH5GLWY.js";
|
|
15
15
|
import {
|
|
16
16
|
__commonJS,
|
|
17
17
|
__require,
|
|
18
18
|
__toESM
|
|
19
|
-
} from "../_node-chunks/chunk-
|
|
19
|
+
} from "../_node-chunks/chunk-I4KLCFNQ.js";
|
|
20
20
|
|
|
21
21
|
// ../../../node_modules/istanbul-lib-report/node_modules/make-dir/index.js
|
|
22
22
|
var require_make_dir = __commonJS({
|
|
@@ -1335,18 +1335,18 @@ var require_istanbul_lib_report = __commonJS({
|
|
|
1335
1335
|
|
|
1336
1336
|
// src/node/coverage-reporter.ts
|
|
1337
1337
|
var import_istanbul_lib_report = __toESM(require_istanbul_lib_report(), 1), StorybookCoverageReporter = class extends import_istanbul_lib_report.ReportBase {
|
|
1338
|
-
#
|
|
1338
|
+
#getTestManager;
|
|
1339
1339
|
constructor(opts) {
|
|
1340
|
-
super(), this.#
|
|
1340
|
+
super(), this.#getTestManager = opts.getTestManager;
|
|
1341
1341
|
}
|
|
1342
1342
|
onSummary(node) {
|
|
1343
1343
|
if (!node.isRoot())
|
|
1344
1344
|
return;
|
|
1345
|
-
let rawCoverageSummary = node.getCoverageSummary(!1), percentage = Math.round(rawCoverageSummary.data.statements.pct), [lowWatermark = 50, highWatermark = 80] =
|
|
1345
|
+
let testManager = this.#getTestManager(), rawCoverageSummary = node.getCoverageSummary(!1), percentage = Math.round(rawCoverageSummary.data.statements.pct), [lowWatermark = 50, highWatermark = 80] = testManager.vitestManager.vitest?.config.coverage.watermarks?.statements ?? [], coverageSummary = {
|
|
1346
1346
|
percentage,
|
|
1347
1347
|
status: percentage < lowWatermark ? "negative" : percentage < highWatermark ? "warning" : "positive"
|
|
1348
1348
|
};
|
|
1349
|
-
|
|
1349
|
+
testManager.onCoverageCollected(coverageSummary);
|
|
1350
1350
|
}
|
|
1351
1351
|
}, coverage_reporter_default = StorybookCoverageReporter;
|
|
1352
1352
|
export {
|
package/dist/node/vitest.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,19 +13,19 @@ import {
|
|
|
13
13
|
errorToErrorLike,
|
|
14
14
|
globalThis_,
|
|
15
15
|
log
|
|
16
|
-
} from "../_node-chunks/chunk-
|
|
16
|
+
} from "../_node-chunks/chunk-6CLSAVWJ.js";
|
|
17
17
|
import {
|
|
18
18
|
any,
|
|
19
19
|
up
|
|
20
|
-
} from "../_node-chunks/chunk-
|
|
21
|
-
import "../_node-chunks/chunk-
|
|
20
|
+
} from "../_node-chunks/chunk-ZBTRLSUY.js";
|
|
21
|
+
import "../_node-chunks/chunk-AF2YLJ2G.js";
|
|
22
22
|
import {
|
|
23
23
|
dirname,
|
|
24
24
|
join,
|
|
25
25
|
normalize,
|
|
26
26
|
path,
|
|
27
27
|
resolve
|
|
28
|
-
} from "../_node-chunks/chunk-
|
|
28
|
+
} from "../_node-chunks/chunk-R32VM5JX.js";
|
|
29
29
|
import {
|
|
30
30
|
ADDON_ID2 as ADDON_ID,
|
|
31
31
|
COVERAGE_DIRECTORY,
|
|
@@ -34,8 +34,8 @@ import {
|
|
|
34
34
|
STORYBOOK_TEST_PROVIDE_KEY,
|
|
35
35
|
STORY_INDEX_CHANNEL_EVENT_NAME,
|
|
36
36
|
storeOptions
|
|
37
|
-
} from "../_node-chunks/chunk-
|
|
38
|
-
import "../_node-chunks/chunk-
|
|
37
|
+
} from "../_node-chunks/chunk-ZGV2ODKH.js";
|
|
38
|
+
import "../_node-chunks/chunk-I4KLCFNQ.js";
|
|
39
39
|
|
|
40
40
|
// src/node/vitest.ts
|
|
41
41
|
import process2 from "node:process";
|
|
@@ -188,23 +188,27 @@ var DOUBLE_SPACES = " ", getTestName = (name) => `${name}${DOUBLE_SPACES}`, Vit
|
|
|
188
188
|
this.vitestStartupCounter = 0;
|
|
189
189
|
this.vitestRestartPromise = null;
|
|
190
190
|
this.runningPromise = null;
|
|
191
|
+
// Tracked here because `vitest.config.coverage.enabled` does not follow `disableCoverage()`.
|
|
192
|
+
this.coverageEnabled = !1;
|
|
191
193
|
}
|
|
192
194
|
async startVitest({ coverage }) {
|
|
193
195
|
let { createVitest, version } = await import("vitest/node");
|
|
194
196
|
this.testNameSeparator = Number.parseInt(version, 10) >= 5 ? " > " : " ";
|
|
195
|
-
let
|
|
196
|
-
|
|
197
|
-
{
|
|
198
|
-
testManager: this.testManager
|
|
199
|
-
}
|
|
200
|
-
], coverageOptions = coverage ? {
|
|
201
|
-
enabled: !0,
|
|
197
|
+
let coverageOptions = {
|
|
198
|
+
enabled: coverage,
|
|
202
199
|
clean: !0,
|
|
203
200
|
cleanOnRerun: !0,
|
|
204
201
|
reportOnFailure: !0,
|
|
205
|
-
reporter: [["html", {}],
|
|
202
|
+
reporter: [["html", {}], [
|
|
203
|
+
"@storybook/addon-vitest/internal/coverage-reporter",
|
|
204
|
+
{
|
|
205
|
+
// A function, not the manager itself: Vitest deep-clones coverage options when coverage
|
|
206
|
+
// is toggled at runtime, and the reporter must reach the live manager.
|
|
207
|
+
getTestManager: () => this.testManager
|
|
208
|
+
}
|
|
209
|
+
]],
|
|
206
210
|
reportsDirectory: resolvePathInStorybookCache(COVERAGE_DIRECTORY)
|
|
207
|
-
}
|
|
211
|
+
}, configDir = this.testManager.storybookOptions.configDir, packageRoot = configDir ? dirname(resolve(configDir)) : void 0, configFiles = [
|
|
208
212
|
...VITEST_CONFIG_FILE_EXTENSIONS.flatMap((ext) => [
|
|
209
213
|
`vitest.config.${ext}`,
|
|
210
214
|
`vite.config.${ext}`
|
|
@@ -245,7 +249,7 @@ var DOUBLE_SPACES = " ", getTestName = (name) => `${name}${DOUBLE_SPACES}`, Vit
|
|
|
245
249
|
// Otherwise it might be hard for the user to discover Storybook related logs
|
|
246
250
|
reporters: ["default", new StorybookReporter(this.testManager)],
|
|
247
251
|
coverage: coverageOptions
|
|
248
|
-
});
|
|
252
|
+
}), this.coverageEnabled = coverage;
|
|
249
253
|
} catch (err) {
|
|
250
254
|
let originalMessage = String(err.message);
|
|
251
255
|
if (originalMessage.includes("Found multiple projects")) {
|
|
@@ -284,6 +288,9 @@ Please install the @vitest/${isIstanbul ? "coverage-istanbul" : "coverage-v8"} p
|
|
|
284
288
|
}
|
|
285
289
|
}), this.vitestRestartPromise;
|
|
286
290
|
}
|
|
291
|
+
async setCoverage(enabled) {
|
|
292
|
+
await this.vitestRestartPromise, !(!this.vitest || this.coverageEnabled === enabled) && (await this.cancelCurrentRun(), enabled ? await this.vitest.enableCoverage() : this.vitest.disableCoverage(), this.coverageEnabled = enabled);
|
|
293
|
+
}
|
|
287
294
|
resetGlobalTestNamePattern() {
|
|
288
295
|
this.vitest?.setGlobalTestNamePattern("");
|
|
289
296
|
}
|
|
@@ -360,8 +367,8 @@ Please install the @vitest/${isIstanbul ? "coverage-istanbul" : "coverage-v8"} p
|
|
|
360
367
|
this.vitest?.provide(STORYBOOK_TEST_PROVIDE_KEY, this.getCurrentRunConfig());
|
|
361
368
|
}
|
|
362
369
|
async runTests(runPayload) {
|
|
363
|
-
let { watching } = this.testManager.store.getState(), coverageShouldBeEnabled = !!this.getCurrentRunConfig().coverage && !watching && (runPayload?.storyIds?.length ?? 0) === 0
|
|
364
|
-
this.vitest ?
|
|
370
|
+
let { watching } = this.testManager.store.getState(), coverageShouldBeEnabled = !!this.getCurrentRunConfig().coverage && !watching && (runPayload?.storyIds?.length ?? 0) === 0;
|
|
371
|
+
this.vitest ? await this.setCoverage(coverageShouldBeEnabled) : await this.startVitest({ coverage: coverageShouldBeEnabled }), this.provideRunConfig(), this.resetGlobalTestNamePattern(), await this.cancelCurrentRun();
|
|
365
372
|
let testSpecifications = await this.getStorybookTestSpecifications(), allStories = this.getStories(), filteredStories = runPayload.storyIds ? allStories.filter((story) => runPayload.storyIds?.includes(story.id)) : allStories;
|
|
366
373
|
if (runPayload.storyIds?.length) {
|
|
367
374
|
let regex = this.buildTestNamePatternForStories(filteredStories, allStories);
|
package/dist/postinstall.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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
|
any
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-ZBTRLSUY.js";
|
|
15
15
|
import {
|
|
16
16
|
require_dist
|
|
17
|
-
} from "./_node-chunks/chunk-
|
|
17
|
+
} from "./_node-chunks/chunk-P3WCWO47.js";
|
|
18
18
|
import {
|
|
19
19
|
dirname,
|
|
20
20
|
normalize,
|
|
21
21
|
relative,
|
|
22
22
|
resolve
|
|
23
|
-
} from "./_node-chunks/chunk-
|
|
23
|
+
} from "./_node-chunks/chunk-R32VM5JX.js";
|
|
24
24
|
import {
|
|
25
25
|
DOCUMENTATION_LINK
|
|
26
|
-
} from "./_node-chunks/chunk-
|
|
26
|
+
} from "./_node-chunks/chunk-ZGV2ODKH.js";
|
|
27
27
|
import {
|
|
28
28
|
__toESM
|
|
29
|
-
} from "./_node-chunks/chunk-
|
|
29
|
+
} from "./_node-chunks/chunk-I4KLCFNQ.js";
|
|
30
30
|
|
|
31
31
|
// src/postinstall.ts
|
|
32
32
|
import * as fs from "node:fs/promises";
|
|
@@ -142,7 +142,7 @@ import {
|
|
|
142
142
|
resolveExpression
|
|
143
143
|
} from "storybook/internal/babel";
|
|
144
144
|
async function getTemplatePath() {
|
|
145
|
-
return import("./_node-chunks/vitest.config.4.template-
|
|
145
|
+
return import("./_node-chunks/vitest.config.4.template-MHVHJLPK.js");
|
|
146
146
|
}
|
|
147
147
|
var loadTemplate = async (name, replacements) => {
|
|
148
148
|
let template = (await getTemplatePath()).default;
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
globalThis_,
|
|
15
15
|
log,
|
|
16
16
|
noop
|
|
17
|
-
} from "./_node-chunks/chunk-
|
|
17
|
+
} from "./_node-chunks/chunk-6CLSAVWJ.js";
|
|
18
18
|
import {
|
|
19
19
|
require_picocolors
|
|
20
|
-
} from "./_node-chunks/chunk-
|
|
20
|
+
} from "./_node-chunks/chunk-AF2YLJ2G.js";
|
|
21
21
|
import {
|
|
22
22
|
require_dist
|
|
23
|
-
} from "./_node-chunks/chunk-
|
|
23
|
+
} from "./_node-chunks/chunk-P3WCWO47.js";
|
|
24
24
|
import {
|
|
25
25
|
normalize
|
|
26
|
-
} from "./_node-chunks/chunk-
|
|
26
|
+
} from "./_node-chunks/chunk-R32VM5JX.js";
|
|
27
27
|
import {
|
|
28
28
|
ADDON_ID2 as ADDON_ID,
|
|
29
29
|
COVERAGE_DIRECTORY,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
TRIGGER_TEST_RUN_REQUEST,
|
|
36
36
|
TRIGGER_TEST_RUN_RESPONSE,
|
|
37
37
|
storeOptions
|
|
38
|
-
} from "./_node-chunks/chunk-
|
|
38
|
+
} from "./_node-chunks/chunk-ZGV2ODKH.js";
|
|
39
39
|
import {
|
|
40
40
|
require_compare,
|
|
41
41
|
require_constants,
|
|
@@ -45,11 +45,11 @@ import {
|
|
|
45
45
|
require_parse_options,
|
|
46
46
|
require_re,
|
|
47
47
|
require_semver
|
|
48
|
-
} from "./_node-chunks/chunk-
|
|
48
|
+
} from "./_node-chunks/chunk-UNH5GLWY.js";
|
|
49
49
|
import {
|
|
50
50
|
__commonJS,
|
|
51
51
|
__toESM
|
|
52
|
-
} from "./_node-chunks/chunk-
|
|
52
|
+
} from "./_node-chunks/chunk-I4KLCFNQ.js";
|
|
53
53
|
|
|
54
54
|
// ../../../node_modules/semver/functions/parse.js
|
|
55
55
|
var require_parse = __commonJS({
|
|
@@ -2095,7 +2095,9 @@ function pipe(...pipe$1) {
|
|
|
2095
2095
|
}
|
|
2096
2096
|
|
|
2097
2097
|
// src/node/toolset/definition.ts
|
|
2098
|
-
import {
|
|
2098
|
+
import {
|
|
2099
|
+
storyInputArraySchema
|
|
2100
|
+
} from "storybook/internal/core-server";
|
|
2099
2101
|
import {
|
|
2100
2102
|
defineToolset
|
|
2101
2103
|
} from "storybook/open-service";
|
|
@@ -2132,6 +2134,16 @@ function countA11yViolations(a11yReports) {
|
|
|
2132
2134
|
"error" in report && report.error || (count += getA11yViolations(report).length);
|
|
2133
2135
|
return count;
|
|
2134
2136
|
}
|
|
2137
|
+
function pluralize(count, singular, plural = `${singular}s`) {
|
|
2138
|
+
return `${count} ${count === 1 ? singular : plural}`;
|
|
2139
|
+
}
|
|
2140
|
+
function countTestRunFailures(result, a11y) {
|
|
2141
|
+
return {
|
|
2142
|
+
componentTests: result.componentTestCount.error,
|
|
2143
|
+
a11yChecks: a11y ? result.a11yCount.error : 0,
|
|
2144
|
+
unhandledErrors: result.unhandledErrors.length
|
|
2145
|
+
};
|
|
2146
|
+
}
|
|
2135
2147
|
function summarizeTestRun(result, a11y) {
|
|
2136
2148
|
return {
|
|
2137
2149
|
passingStoryCount: result.componentTestStatuses.filter(isPassing).length,
|
|
@@ -2146,14 +2158,16 @@ function formatPassingStoriesSection(passingStories) {
|
|
|
2146
2158
|
- ${passingStories.map((status) => status.storyId).join(`
|
|
2147
2159
|
- `)}`;
|
|
2148
2160
|
}
|
|
2161
|
+
var A11Y_CHECK_FAILED = "The accessibility check failed; see Accessibility Violations below.";
|
|
2149
2162
|
function formatFailingStoriesSection(statuses) {
|
|
2150
2163
|
return `## Failing Stories
|
|
2151
2164
|
|
|
2152
|
-
${statuses.map(
|
|
2153
|
-
(status)
|
|
2165
|
+
${statuses.map((status) => {
|
|
2166
|
+
let details = isFailing(status) ? status.description || "No failure details available." : A11Y_CHECK_FAILED;
|
|
2167
|
+
return `### ${status.storyId}
|
|
2154
2168
|
|
|
2155
|
-
${
|
|
2156
|
-
).join(`
|
|
2169
|
+
${details}`;
|
|
2170
|
+
}).join(`
|
|
2157
2171
|
|
|
2158
2172
|
`)}`;
|
|
2159
2173
|
}
|
|
@@ -2209,27 +2223,68 @@ ${unhandledError.stack || "No stack trace available"}`
|
|
|
2209
2223
|
|
|
2210
2224
|
`)}`;
|
|
2211
2225
|
}
|
|
2212
|
-
function
|
|
2213
|
-
let
|
|
2226
|
+
function formatA11yCounts({ success, warning, error }, a11yEnabled) {
|
|
2227
|
+
let checked = success + warning + error;
|
|
2228
|
+
if (checked === 0)
|
|
2229
|
+
return a11yEnabled ? "Accessibility: not checked." : "Accessibility: not checked (addon-a11y is not enabled).";
|
|
2230
|
+
if (warning === 0 && error === 0)
|
|
2231
|
+
return `Accessibility: ${pluralize(checked, "story", "stories")} checked, no violations.`;
|
|
2232
|
+
let parts = [
|
|
2233
|
+
success > 0 ? `${success} without violations` : void 0,
|
|
2234
|
+
warning > 0 ? `${warning} with violations reported as warnings, which do not fail the run` : void 0,
|
|
2235
|
+
error > 0 ? `${error} failing the run` : void 0
|
|
2236
|
+
].filter(Boolean);
|
|
2237
|
+
return `Accessibility: ${pluralize(checked, "story", "stories")} checked; ${parts.join("; ")}.`;
|
|
2238
|
+
}
|
|
2239
|
+
function formatA11yResult(result, { a11y, a11yEnabled }) {
|
|
2240
|
+
if (!a11y)
|
|
2241
|
+
return "Accessibility: skipped (a11y: false).";
|
|
2242
|
+
let counts = formatA11yCounts(result.a11yCount, a11yEnabled);
|
|
2243
|
+
return result.componentTestCount.error > 0 ? `${counts} Stories with a failing component test get no accessibility result.` : counts;
|
|
2244
|
+
}
|
|
2245
|
+
var FAILURE_LABELS = {
|
|
2246
|
+
componentTests: (count) => `${pluralize(count, "component test")} failed`,
|
|
2247
|
+
a11yChecks: (count) => `${pluralize(count, "accessibility check")} failed`,
|
|
2248
|
+
unhandledErrors: (count) => pluralize(count, "unhandled error")
|
|
2249
|
+
};
|
|
2250
|
+
function formatResultSection(result, { a11y, a11yEnabled }) {
|
|
2251
|
+
let failures = countTestRunFailures(result, a11y), failureParts = Object.keys(FAILURE_LABELS).filter((key) => failures[key] > 0).map((key) => FAILURE_LABELS[key](failures[key]));
|
|
2252
|
+
return `## Result
|
|
2253
|
+
|
|
2254
|
+
${failureParts.length > 0 ? `Failed: ${failureParts.join(", ")}.` : result.componentTestCount.success === 0 ? "No component tests ran." : `Passed: ${pluralize(result.componentTestCount.success, "component test")} passed.`}
|
|
2255
|
+
${formatA11yResult(result, { a11y, a11yEnabled })}`;
|
|
2256
|
+
}
|
|
2257
|
+
function formatCompletedRun(result, { a11y, a11yEnabled, origin }) {
|
|
2258
|
+
let sections = [], a11yFailingStoryIds = new Set(
|
|
2259
|
+
a11y ? result.a11yStatuses.filter(isFailing).map((status) => status.storyId) : []
|
|
2260
|
+
), passingStories = result.componentTestStatuses.filter(
|
|
2261
|
+
(status) => isPassing(status) && !a11yFailingStoryIds.has(status.storyId)
|
|
2262
|
+
), failingStories = result.componentTestStatuses.filter(
|
|
2263
|
+
(status) => isFailing(status) || a11yFailingStoryIds.has(status.storyId)
|
|
2264
|
+
);
|
|
2214
2265
|
passingStories.length > 0 && sections.push(formatPassingStoriesSection(passingStories)), failingStories.length > 0 && sections.push(formatFailingStoriesSection(failingStories));
|
|
2215
2266
|
let a11yReports = getA11yReports(result);
|
|
2216
2267
|
if (a11y && a11yReports && Object.keys(a11yReports).length > 0) {
|
|
2217
2268
|
let a11ySection = formatA11yReportsSection({ a11yReports, origin });
|
|
2218
2269
|
a11ySection && sections.push(a11ySection);
|
|
2219
2270
|
}
|
|
2220
|
-
return result.unhandledErrors.length > 0 && sections.push(formatUnhandledErrorsSection(result.unhandledErrors)), sections.join(`
|
|
2271
|
+
return result.unhandledErrors.length > 0 && sections.push(formatUnhandledErrorsSection(result.unhandledErrors)), sections.push(formatResultSection(result, { a11y, a11yEnabled })), sections.join(`
|
|
2221
2272
|
|
|
2222
2273
|
`);
|
|
2223
2274
|
}
|
|
2224
|
-
function formatTestRun(data, ctx) {
|
|
2275
|
+
function formatTestRun(data, ctx, { a11yEnabled }) {
|
|
2225
2276
|
switch (data.status) {
|
|
2226
2277
|
case "no-stories":
|
|
2227
|
-
return `No stories found matching the provided input.
|
|
2278
|
+
return data.notFoundMessages.length === 0 ? "No stories were given, so no tests ran. Pass story IDs in `stories`, or omit it to run every story test." : `No stories found matching the provided input.
|
|
2228
2279
|
|
|
2229
2280
|
${data.notFoundMessages.join(`
|
|
2230
2281
|
`)}`;
|
|
2231
2282
|
case "completed":
|
|
2232
|
-
return formatCompletedRun(data.result, {
|
|
2283
|
+
return formatCompletedRun(data.result, {
|
|
2284
|
+
a11y: data.a11y,
|
|
2285
|
+
a11yEnabled,
|
|
2286
|
+
origin: ctx.origin
|
|
2287
|
+
});
|
|
2233
2288
|
case "error":
|
|
2234
2289
|
return `Error: ${data.error.message}`;
|
|
2235
2290
|
case "cancelled":
|
|
@@ -2495,14 +2550,18 @@ function isFailedRun(data) {
|
|
|
2495
2550
|
case "cancelled":
|
|
2496
2551
|
return !0;
|
|
2497
2552
|
case "completed":
|
|
2498
|
-
return data.result
|
|
2553
|
+
return Object.values(countTestRunFailures(data.result, data.a11y)).some((count) => count > 0);
|
|
2499
2554
|
case "no-stories":
|
|
2500
2555
|
return !1;
|
|
2501
2556
|
default:
|
|
2502
2557
|
return data;
|
|
2503
2558
|
}
|
|
2504
2559
|
}
|
|
2505
|
-
function createTestToolset({
|
|
2560
|
+
function createTestToolset({
|
|
2561
|
+
channel,
|
|
2562
|
+
storyIndex,
|
|
2563
|
+
a11yEnabled
|
|
2564
|
+
}) {
|
|
2506
2565
|
let queue = createAsyncQueue();
|
|
2507
2566
|
return defineToolset({
|
|
2508
2567
|
id: "test",
|
|
@@ -2520,7 +2579,7 @@ function createTestToolset({ channel, storyIndex, a11yEnabled }) {
|
|
|
2520
2579
|
getIndex: storyIndex.getIndex,
|
|
2521
2580
|
stories: input.stories,
|
|
2522
2581
|
a11y: input.a11y
|
|
2523
|
-
}), a11y: input.a11y }, markdown = formatTestRun(data, ctx), telemetry2 = runTelemetry(data, input);
|
|
2582
|
+
}), a11y: input.a11y }, markdown = formatTestRun(data, ctx, { a11yEnabled }), telemetry2 = runTelemetry(data, input);
|
|
2524
2583
|
return isFailedRun(data) ? { ok: !1, data, markdown, telemetry: telemetry2 } : { ok: !0, data, markdown, telemetry: telemetry2 };
|
|
2525
2584
|
} finally {
|
|
2526
2585
|
done();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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-I4KLCFNQ.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_mcj5sbv12wm from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mcj5sbv12wm from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mcj5sbv12wm from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mcj5sbv12wm.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mcj5sbv12wm.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mcj5sbv12wm.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-AF2YLJ2G.js";
|
|
15
15
|
import {
|
|
16
16
|
require_dist
|
|
17
|
-
} from "../_node-chunks/chunk-
|
|
17
|
+
} from "../_node-chunks/chunk-P3WCWO47.js";
|
|
18
18
|
import {
|
|
19
19
|
join,
|
|
20
20
|
normalize,
|
|
@@ -22,13 +22,13 @@ import {
|
|
|
22
22
|
relative,
|
|
23
23
|
resolve,
|
|
24
24
|
sep
|
|
25
|
-
} from "../_node-chunks/chunk-
|
|
25
|
+
} from "../_node-chunks/chunk-R32VM5JX.js";
|
|
26
26
|
import {
|
|
27
27
|
STORYBOOK_CORE_GHOST_STORIES_PROVIDE_KEY,
|
|
28
28
|
STORYBOOK_CORE_RENDER_ANALYSIS_PROVIDE_KEY,
|
|
29
29
|
STORYBOOK_TEST_FEATURES_PROVIDE_KEY,
|
|
30
30
|
STORYBOOK_TEST_INITIAL_GLOBALS_PROVIDE_KEY
|
|
31
|
-
} from "../_node-chunks/chunk-
|
|
31
|
+
} from "../_node-chunks/chunk-ZGV2ODKH.js";
|
|
32
32
|
import {
|
|
33
33
|
__commonJS,
|
|
34
34
|
__esm,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
__require,
|
|
37
37
|
__toCommonJS,
|
|
38
38
|
__toESM
|
|
39
|
-
} from "../_node-chunks/chunk-
|
|
39
|
+
} from "../_node-chunks/chunk-I4KLCFNQ.js";
|
|
40
40
|
|
|
41
41
|
// ../../../node_modules/braces/lib/utils.js
|
|
42
42
|
var require_utils = __commonJS({
|
|
@@ -2626,10 +2626,8 @@ var WORKING_DIR = process.cwd(), defaultOptions = {
|
|
|
2626
2626
|
onStackTrace: (error, frame) => isStorybookInternalFrame(frame.file) ? !1 : nonMutableInputConfig.test?.onStackTrace?.(error, frame) ?? !0,
|
|
2627
2627
|
setupFiles: [
|
|
2628
2628
|
"@storybook/addon-vitest/internal/setup-file",
|
|
2629
|
-
"@storybook/addon-vitest/internal/setup-file-with-project-annotations"
|
|
2630
|
-
|
|
2631
|
-
typeof nonMutableInputConfig.test?.setupFiles == "string" && nonMutableInputConfig.test?.setupFiles
|
|
2632
|
-
].filter(Boolean),
|
|
2629
|
+
"@storybook/addon-vitest/internal/setup-file-with-project-annotations"
|
|
2630
|
+
],
|
|
2633
2631
|
...finalOptions.storybookScript ? {
|
|
2634
2632
|
globalSetup: [
|
|
2635
2633
|
fileURLToPath(
|
|
@@ -2692,7 +2690,10 @@ var WORKING_DIR = process.cwd(), defaultOptions = {
|
|
|
2692
2690
|
// @testing-library/dom) reach the browser raw on hoisted node_modules layouts
|
|
2693
2691
|
"storybook/test",
|
|
2694
2692
|
...frameworkName?.includes("react") || frameworkName?.includes("nextjs") ? ["react-dom/test-utils"] : []
|
|
2695
|
-
]
|
|
2693
|
+
],
|
|
2694
|
+
// Vitest only excludes these when coverage is enabled at startup. Storybook can enable
|
|
2695
|
+
// coverage later, and without this Vite would optimize them mid-run and reload the tests.
|
|
2696
|
+
exclude: ["@vitest/coverage-v8/browser", "@vitest/coverage-istanbul"]
|
|
2696
2697
|
},
|
|
2697
2698
|
define: {
|
|
2698
2699
|
...frameworkName?.includes("vue3") ? { __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false" } : {},
|
|
@@ -70,7 +70,14 @@ var DEFAULT_VIEWPORT_DIMENSIONS = {
|
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
// src/vitest-plugin/test-utils.ts
|
|
73
|
-
var convertToFilePath = (url) =>
|
|
73
|
+
var convertToFilePath = (url) => {
|
|
74
|
+
let normalizedPath = url.replace(/^file:\/\//, "").replace(/^\/+([a-zA-Z]:)/, "$1");
|
|
75
|
+
try {
|
|
76
|
+
return decodeURIComponent(normalizedPath);
|
|
77
|
+
} catch {
|
|
78
|
+
return normalizedPath;
|
|
79
|
+
}
|
|
80
|
+
}, testStory = ({
|
|
74
81
|
exportName,
|
|
75
82
|
story,
|
|
76
83
|
meta,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-vitest",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.7",
|
|
4
4
|
"description": "Storybook Vitest addon: Blazing fast component testing using stories",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"@storybook/icons": "^2.0.2"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@storybook/addon-a11y": "11.0.0-alpha.
|
|
85
|
-
"@storybook/builder-vite": "11.0.0-alpha.
|
|
84
|
+
"@storybook/addon-a11y": "11.0.0-alpha.7",
|
|
85
|
+
"@storybook/builder-vite": "11.0.0-alpha.7",
|
|
86
86
|
"@types/istanbul-lib-report": "^3.0.3",
|
|
87
87
|
"@types/micromatch": "^4.0.0",
|
|
88
88
|
"@types/node": "^22.19.1",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"peerDependencies": {
|
|
111
111
|
"@vitest/browser": "^4.0.0 || ^5.0.0",
|
|
112
112
|
"@vitest/browser-playwright": "^4.0.0 || ^5.0.0",
|
|
113
|
-
"storybook": "^11.0.0-alpha.
|
|
113
|
+
"storybook": "^11.0.0-alpha.7",
|
|
114
114
|
"vitest": "^4.0.0 || ^5.0.0"
|
|
115
115
|
},
|
|
116
116
|
"peerDependenciesMeta": {
|