@storybook/addon-vitest 0.0.0-pr-32597-sha-4bc605b4 → 0.0.0-pr-32759-sha-ea80f897

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.
Files changed (41) hide show
  1. package/dist/chunk-55WZLVGN.mjs +11 -0
  2. package/dist/chunk-JKRQGT2U.mjs +10 -0
  3. package/dist/index.js +6 -9
  4. package/dist/index.mjs +5 -0
  5. package/dist/manager.js +8 -958
  6. package/dist/node/coverage-reporter.d.ts +184 -0
  7. package/dist/node/coverage-reporter.js +4 -1898
  8. package/dist/node/coverage-reporter.mjs +12 -0
  9. package/dist/node/vitest.d.ts +2 -0
  10. package/dist/node/vitest.js +17 -892
  11. package/dist/node/vitest.mjs +19 -0
  12. package/dist/postinstall.js +87 -2086
  13. package/dist/preset.js +35 -615
  14. package/dist/vitest-plugin/global-setup.d.ts +6 -0
  15. package/dist/vitest-plugin/global-setup.js +6 -200
  16. package/dist/vitest-plugin/global-setup.mjs +13 -0
  17. package/dist/vitest-plugin/index.js +43 -3826
  18. package/dist/vitest-plugin/index.mjs +28 -0
  19. package/dist/vitest-plugin/setup-file.d.ts +14 -0
  20. package/dist/vitest-plugin/setup-file.js +8 -30
  21. package/dist/vitest-plugin/setup-file.mjs +9 -0
  22. package/dist/vitest-plugin/test-utils.d.ts +20 -0
  23. package/dist/vitest-plugin/test-utils.js +8 -105
  24. package/dist/vitest-plugin/test-utils.mjs +8 -0
  25. package/manager.js +1 -1
  26. package/manager.mjs +1 -0
  27. package/package.json +91 -18
  28. package/postinstall.js +1 -0
  29. package/postinstall.mjs +1 -0
  30. package/preset.js +1 -1
  31. package/preset.mjs +1 -0
  32. package/dist/_browser-chunks/chunk-JK72E6FR.js +0 -6
  33. package/dist/_browser-chunks/chunk-PMYV6BH2.js +0 -76
  34. package/dist/_node-chunks/chunk-2HPAV6GF.js +0 -98
  35. package/dist/_node-chunks/chunk-MAQGJY7P.js +0 -2574
  36. package/dist/_node-chunks/chunk-N2MLPWF6.js +0 -103
  37. package/dist/_node-chunks/chunk-TUYNCG36.js +0 -91
  38. package/dist/_node-chunks/chunk-UD3V4PK3.js +0 -37
  39. package/dist/_node-chunks/chunk-VVSEYRVS.js +0 -481
  40. package/dist/_node-chunks/chunk-WXPBOWQH.js +0 -247
  41. package/dist/_node-chunks/chunk-XPVNQSCP.js +0 -50
@@ -1,103 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_p5l39hef73f from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_p5l39hef73f from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_p5l39hef73f from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_p5l39hef73f.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_p5l39hef73f.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_p5l39hef73f.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
-
13
- // ../../core/src/component-testing/constants.ts
14
- var ADDON_ID = "storybook/interactions";
15
- var PANEL_ID = `${ADDON_ID}/panel`;
16
- var DOCUMENTATION_LINK = "writing-tests/integrations/vitest-addon";
17
- var DOCUMENTATION_DISCREPANCY_LINK = `${DOCUMENTATION_LINK}#what-happens-when-there-are-different-test-results-in-multiple-environments`;
18
-
19
- // ../a11y/src/constants.ts
20
- var ADDON_ID2 = "storybook/a11y";
21
- var PANEL_ID2 = `${ADDON_ID2}/panel`;
22
- var RESULT = `${ADDON_ID2}/result`;
23
- var REQUEST = `${ADDON_ID2}/request`;
24
- var RUNNING = `${ADDON_ID2}/running`;
25
- var ERROR = `${ADDON_ID2}/error`;
26
- var MANUAL = `${ADDON_ID2}/manual`;
27
- var SELECT = `${ADDON_ID2}/select`;
28
- var DOCUMENTATION_LINK2 = "writing-tests/accessibility-testing";
29
- var DOCUMENTATION_DISCREPANCY_LINK2 = `${DOCUMENTATION_LINK2}#why-are-my-tests-failing-in-different-environments`;
30
-
31
- // src/constants.ts
32
- var ADDON_ID3 = "storybook/test";
33
- var TEST_PROVIDER_ID = `${ADDON_ID3}/test-provider`;
34
- var STORYBOOK_ADDON_TEST_CHANNEL = "STORYBOOK_ADDON_TEST_CHANNEL";
35
- var DOCUMENTATION_LINK3 = "writing-tests/integrations/vitest-addon";
36
- var DOCUMENTATION_FATAL_ERROR_LINK = `${DOCUMENTATION_LINK3}#what-happens-if-vitest-itself-has-an-error`;
37
- var COVERAGE_DIRECTORY = "coverage";
38
- var SUPPORTED_FRAMEWORKS = [
39
- "@storybook/nextjs",
40
- "@storybook/nextjs-vite",
41
- "@storybook/react-vite",
42
- "@storybook/svelte-vite",
43
- "@storybook/vue3-vite",
44
- "@storybook/html-vite",
45
- "@storybook/web-components-vite",
46
- "@storybook/sveltekit",
47
- "@storybook/react-native-web-vite"
48
- ];
49
- var storeOptions = {
50
- id: ADDON_ID3,
51
- initialState: {
52
- config: {
53
- coverage: false,
54
- a11y: false
55
- },
56
- watching: false,
57
- cancelling: false,
58
- fatalError: void 0,
59
- indexUrl: void 0,
60
- previewAnnotations: [],
61
- currentRun: {
62
- triggeredBy: void 0,
63
- config: {
64
- coverage: false,
65
- a11y: false
66
- },
67
- componentTestCount: {
68
- success: 0,
69
- error: 0
70
- },
71
- a11yCount: {
72
- success: 0,
73
- warning: 0,
74
- error: 0
75
- },
76
- storyIds: void 0,
77
- totalTestCount: void 0,
78
- startedAt: void 0,
79
- finishedAt: void 0,
80
- unhandledErrors: [],
81
- coverageSummary: void 0
82
- }
83
- }
84
- };
85
- var STORE_CHANNEL_EVENT_NAME = `UNIVERSAL_STORE:${storeOptions.id}`;
86
- var STATUS_STORE_CHANNEL_EVENT_NAME = "UNIVERSAL_STORE:storybook/status";
87
- var TEST_PROVIDER_STORE_CHANNEL_EVENT_NAME = "UNIVERSAL_STORE:storybook/test-provider";
88
- var STATUS_TYPE_ID_COMPONENT_TEST = "storybook/component-test";
89
- var STATUS_TYPE_ID_A11Y = "storybook/a11y";
90
-
91
- export {
92
- ADDON_ID3 as ADDON_ID,
93
- STORYBOOK_ADDON_TEST_CHANNEL,
94
- DOCUMENTATION_LINK3 as DOCUMENTATION_LINK,
95
- COVERAGE_DIRECTORY,
96
- SUPPORTED_FRAMEWORKS,
97
- storeOptions,
98
- STORE_CHANNEL_EVENT_NAME,
99
- STATUS_STORE_CHANNEL_EVENT_NAME,
100
- TEST_PROVIDER_STORE_CHANNEL_EVENT_NAME,
101
- STATUS_TYPE_ID_COMPONENT_TEST,
102
- STATUS_TYPE_ID_A11Y
103
- };
@@ -1,91 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_p5l39hef73f from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_p5l39hef73f from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_p5l39hef73f from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_p5l39hef73f.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_p5l39hef73f.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_p5l39hef73f.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- __commonJS,
14
- __name
15
- } from "./chunk-XPVNQSCP.js";
16
-
17
- // ../../node_modules/picocolors/picocolors.js
18
- var require_picocolors = __commonJS({
19
- "../../node_modules/picocolors/picocolors.js"(exports, module) {
20
- var p = process || {};
21
- var argv = p.argv || [];
22
- var env = p.env || {};
23
- var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
24
- var formatter = /* @__PURE__ */ __name((open, close, replace = open) => (input) => {
25
- let string = "" + input, index = string.indexOf(close, open.length);
26
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
27
- }, "formatter");
28
- var replaceClose = /* @__PURE__ */ __name((string, close, replace, index) => {
29
- let result = "", cursor = 0;
30
- do {
31
- result += string.substring(cursor, index) + replace;
32
- cursor = index + close.length;
33
- index = string.indexOf(close, cursor);
34
- } while (~index);
35
- return result + string.substring(cursor);
36
- }, "replaceClose");
37
- var createColors = /* @__PURE__ */ __name((enabled = isColorSupported) => {
38
- let f = enabled ? formatter : () => String;
39
- return {
40
- isColorSupported: enabled,
41
- reset: f("\x1B[0m", "\x1B[0m"),
42
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
43
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
44
- italic: f("\x1B[3m", "\x1B[23m"),
45
- underline: f("\x1B[4m", "\x1B[24m"),
46
- inverse: f("\x1B[7m", "\x1B[27m"),
47
- hidden: f("\x1B[8m", "\x1B[28m"),
48
- strikethrough: f("\x1B[9m", "\x1B[29m"),
49
- black: f("\x1B[30m", "\x1B[39m"),
50
- red: f("\x1B[31m", "\x1B[39m"),
51
- green: f("\x1B[32m", "\x1B[39m"),
52
- yellow: f("\x1B[33m", "\x1B[39m"),
53
- blue: f("\x1B[34m", "\x1B[39m"),
54
- magenta: f("\x1B[35m", "\x1B[39m"),
55
- cyan: f("\x1B[36m", "\x1B[39m"),
56
- white: f("\x1B[37m", "\x1B[39m"),
57
- gray: f("\x1B[90m", "\x1B[39m"),
58
- bgBlack: f("\x1B[40m", "\x1B[49m"),
59
- bgRed: f("\x1B[41m", "\x1B[49m"),
60
- bgGreen: f("\x1B[42m", "\x1B[49m"),
61
- bgYellow: f("\x1B[43m", "\x1B[49m"),
62
- bgBlue: f("\x1B[44m", "\x1B[49m"),
63
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
64
- bgCyan: f("\x1B[46m", "\x1B[49m"),
65
- bgWhite: f("\x1B[47m", "\x1B[49m"),
66
- blackBright: f("\x1B[90m", "\x1B[39m"),
67
- redBright: f("\x1B[91m", "\x1B[39m"),
68
- greenBright: f("\x1B[92m", "\x1B[39m"),
69
- yellowBright: f("\x1B[93m", "\x1B[39m"),
70
- blueBright: f("\x1B[94m", "\x1B[39m"),
71
- magentaBright: f("\x1B[95m", "\x1B[39m"),
72
- cyanBright: f("\x1B[96m", "\x1B[39m"),
73
- whiteBright: f("\x1B[97m", "\x1B[39m"),
74
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
75
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
76
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
77
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
78
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
79
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
80
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
81
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
82
- };
83
- }, "createColors");
84
- module.exports = createColors();
85
- module.exports.createColors = createColors;
86
- }
87
- });
88
-
89
- export {
90
- require_picocolors
91
- };
@@ -1,37 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_p5l39hef73f from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_p5l39hef73f from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_p5l39hef73f from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_p5l39hef73f.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_p5l39hef73f.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_p5l39hef73f.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- ADDON_ID
14
- } from "./chunk-N2MLPWF6.js";
15
- import {
16
- require_picocolors
17
- } from "./chunk-TUYNCG36.js";
18
- import {
19
- __name,
20
- __toESM
21
- } from "./chunk-XPVNQSCP.js";
22
-
23
- // src/logger.ts
24
- var import_picocolors = __toESM(require_picocolors(), 1);
25
- var log = /* @__PURE__ */ __name((message) => {
26
- console.log(`${import_picocolors.default.magenta(ADDON_ID)}: ${message.toString().trim()}`);
27
- }, "log");
28
-
29
- // ../../node_modules/es-toolkit/dist/function/noop.mjs
30
- function noop() {
31
- }
32
- __name(noop, "noop");
33
-
34
- export {
35
- noop,
36
- log
37
- };