@storybook/addon-vitest 11.0.0-rc.3 → 11.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { createRequire as CJS_COMPAT_CREATE_REQUIRE_ljze7ktjwle } from "node:module";var require = CJS_COMPAT_CREATE_REQUIRE_ljze7ktjwle(import.meta.url);
1
+ import { createRequire as CJS_COMPAT_CREATE_REQUIRE_rvnpllslez } from "node:module";var require = CJS_COMPAT_CREATE_REQUIRE_rvnpllslez(import.meta.url);
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
package/dist/manager.js CHANGED
@@ -30,6 +30,19 @@ var store = internal_UniversalStore.create({
30
30
  leader: globalThis.CONFIG_TYPE === "PRODUCTION"
31
31
  }), componentTestStatusStore = experimental_getStatusStore(STATUS_TYPE_ID_COMPONENT_TEST), a11yStatusStore = experimental_getStatusStore(STATUS_TYPE_ID_A11Y), testProviderStore = experimental_getTestProviderStore(ADDON_ID2);
32
32
 
33
+ // ../../../node_modules/es-toolkit/dist/object/omit.mjs
34
+ function omit(obj, keys) {
35
+ let result = { ...obj };
36
+ for (let i = 0; i < keys.length; i++) {
37
+ let key = keys[i];
38
+ delete result[key];
39
+ }
40
+ return result;
41
+ }
42
+
43
+ // ../../../node_modules/es-toolkit/dist/string/words.mjs
44
+ var CASE_SPLIT_PATTERN = new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+", "gu");
45
+
33
46
  // src/manager.tsx
34
47
  import { Tag, addons as addons2 } from "storybook/manager-api";
35
48
 
@@ -566,7 +579,10 @@ addons2.register(ADDON_ID2, (api) => {
566
579
  }), a11yStatusStore.onSelect(() => {
567
580
  openPanel2(PANEL_ID2);
568
581
  }), store.subscribe("TEST_RUN_COMPLETED", ({ payload }) => {
569
- api.emit(STORYBOOK_ADDON_TEST_CHANNEL, { type: "test-run-completed", payload });
582
+ api.emit(STORYBOOK_ADDON_TEST_CHANNEL, {
583
+ type: "test-run-completed",
584
+ payload: omit(payload, ["reports", "a11yReports"])
585
+ });
570
586
  }), addons2.add(TEST_PROVIDER_ID, {
571
587
  type: Addon_TypesEnum.experimental_TEST_PROVIDER,
572
588
  clear: () => {
@@ -76,6 +76,16 @@ function throttle(func, throttleMs, { signal, edges = ["leading", "trailing"] }
76
76
  return throttled.cancel = debounced.cancel, throttled.flush = debounced.flush, throttled;
77
77
  }
78
78
 
79
+ // ../../../node_modules/es-toolkit/dist/object/omit.mjs
80
+ function omit(obj, keys) {
81
+ let result = { ...obj };
82
+ for (let i = 0; i < keys.length; i++) {
83
+ let key = keys[i];
84
+ delete result[key];
85
+ }
86
+ return result;
87
+ }
88
+
79
89
  // src/node/vitest-manager.ts
80
90
  import { existsSync, readFileSync } from "node:fs";
81
91
  import { getProjectRoot, resolvePathInStorybookCache } from "storybook/internal/common";
@@ -459,7 +469,10 @@ Please install the @vitest/${isIstanbul ? "coverage-istanbul" : "coverage-v8"} p
459
469
  };
460
470
 
461
471
  // src/node/test-manager.ts
462
- var DEBUG_BANNER_RE = /\n?(?:\x1B\[\d+m)?Click to debug the error directly in Storybook: [^\n]*\n+/g;
472
+ var trimA11yReport = (report) => report.type !== "a11y" || !report.result ? report : {
473
+ ...report,
474
+ result: omit(report.result, ["passes", "inapplicable"])
475
+ }, DEBUG_BANNER_RE = /\n?(?:\x1B\[\d+m)?Click to debug the error directly in Storybook: [^\n]*\n+/g;
463
476
  function formatError(error) {
464
477
  if (!error.stacks?.length)
465
478
  return error.stack || error.message || "";
@@ -649,7 +662,11 @@ var testStateToStatusValueMap = {
649
662
  if (!storyId)
650
663
  return;
651
664
  let requestedStoryIds = this.store.getState().currentRun.storyIds;
652
- requestedStoryIds && !this.isRequestedStoryOrChild(storyId, requestedStoryIds) || (this.batchedTestCaseResults.push({ storyId, testResult, reports }), this.throttledFlushTestCaseResults());
665
+ requestedStoryIds && !this.isRequestedStoryOrChild(storyId, requestedStoryIds) || (this.batchedTestCaseResults.push({
666
+ storyId,
667
+ testResult,
668
+ reports: reports?.map(trimA11yReport)
669
+ }), this.throttledFlushTestCaseResults());
653
670
  }
654
671
  isRequestedStoryOrChild(storyId, requestedStoryIds) {
655
672
  if (requestedStoryIds.includes(storyId))
@@ -2354,7 +2354,7 @@ import {
2354
2354
  var import_picocolors = __toESM(require_picocolors(), 1), import_sirv = __toESM(require_build(), 1), import_ts_dedent2 = __toESM(require_dist(), 1);
2355
2355
 
2356
2356
  // package.json
2357
- var version = "11.0.0-rc.3";
2357
+ var version = "11.0.0-rc.4";
2358
2358
 
2359
2359
  // ../../builders/builder-vite/src/utils/without-vite-plugins.ts
2360
2360
  var withoutVitePlugins = async (plugins = [], namesToRemove) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-vitest",
3
- "version": "11.0.0-rc.3",
3
+ "version": "11.0.0-rc.4",
4
4
  "description": "Storybook Vitest addon: Blazing fast component testing using stories",
5
5
  "keywords": [
6
6
  "storybook",
@@ -80,8 +80,8 @@
80
80
  "@storybook/icons": "^2.0.2"
81
81
  },
82
82
  "devDependencies": {
83
- "@storybook/addon-a11y": "11.0.0-rc.3",
84
- "@storybook/builder-vite": "11.0.0-rc.3",
83
+ "@storybook/addon-a11y": "11.0.0-rc.4",
84
+ "@storybook/builder-vite": "11.0.0-rc.4",
85
85
  "@types/istanbul-lib-report": "^3.0.3",
86
86
  "@types/micromatch": "^4.0.0",
87
87
  "@types/node": "^22.19.1",
@@ -109,7 +109,7 @@
109
109
  "peerDependencies": {
110
110
  "@vitest/browser": "^4.0.0 || ^5.0.0",
111
111
  "@vitest/browser-playwright": "^4.0.0 || ^5.0.0",
112
- "storybook": "^11.0.0-rc.3",
112
+ "storybook": "^11.0.0-rc.4",
113
113
  "vitest": "^4.0.0 || ^5.0.0"
114
114
  },
115
115
  "peerDependenciesMeta": {