@storybook/addon-vitest 10.1.0-alpha.10 → 10.1.0-alpha.11
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/_browser-chunks/chunk-ULSHVN74.js +60 -0
- package/dist/_node-chunks/{chunk-7SKPZV4T.js → chunk-2WX72TIY.js} +11 -13
- package/dist/_node-chunks/chunk-BEGZGAUW.js +1697 -0
- package/dist/_node-chunks/chunk-CHRIX3Z2.js +339 -0
- package/dist/_node-chunks/{chunk-7J6TCEGO.js → chunk-FCFZB5YS.js} +14 -19
- package/dist/_node-chunks/chunk-FD2MOKYY.js +69 -0
- package/dist/_node-chunks/chunk-L7WYCUSW.js +138 -0
- package/dist/_node-chunks/chunk-TCQNKRGF.js +83 -0
- package/dist/_node-chunks/{chunk-U3WHYFEY.js → chunk-XN666246.js} +15 -24
- package/dist/index.js +1 -5
- package/dist/manager.js +163 -354
- package/dist/node/coverage-reporter.js +319 -864
- package/dist/node/vitest.js +189 -454
- package/dist/postinstall.js +476 -1343
- package/dist/preset.js +150 -338
- package/dist/vitest-plugin/global-setup.js +50 -105
- package/dist/vitest-plugin/index.js +1160 -2377
- package/dist/vitest-plugin/setup-file.js +6 -12
- package/dist/vitest-plugin/test-utils.js +31 -71
- package/package.json +3 -3
- package/dist/_browser-chunks/chunk-CAYLRBRX.js +0 -77
- package/dist/_browser-chunks/chunk-JK72E6FR.js +0 -6
- package/dist/_node-chunks/chunk-2GFDFSMJ.js +0 -98
- package/dist/_node-chunks/chunk-2VMVOZSQ.js +0 -247
- package/dist/_node-chunks/chunk-3G477K5F.js +0 -481
- package/dist/_node-chunks/chunk-ESR57AJV.js +0 -105
- package/dist/_node-chunks/chunk-VQBCAO3Q.js +0 -2574
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zfiyucf8tb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zfiyucf8tb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zfiyucf8tb from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zfiyucf8tb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zfiyucf8tb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zfiyucf8tb.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", PANEL_ID = `${ADDON_ID}/panel`, DOCUMENTATION_LINK = "writing-tests/integrations/vitest-addon", DOCUMENTATION_DISCREPANCY_LINK = `${DOCUMENTATION_LINK}#what-happens-when-there-are-different-test-results-in-multiple-environments`;
|
|
15
|
+
|
|
16
|
+
// ../a11y/src/constants.ts
|
|
17
|
+
var ADDON_ID2 = "storybook/a11y", PANEL_ID2 = `${ADDON_ID2}/panel`;
|
|
18
|
+
var UI_STATE_ID = `${ADDON_ID2}/ui`, RESULT = `${ADDON_ID2}/result`, REQUEST = `${ADDON_ID2}/request`, RUNNING = `${ADDON_ID2}/running`, ERROR = `${ADDON_ID2}/error`, MANUAL = `${ADDON_ID2}/manual`, SELECT = `${ADDON_ID2}/select`, DOCUMENTATION_LINK2 = "writing-tests/accessibility-testing", DOCUMENTATION_DISCREPANCY_LINK2 = `${DOCUMENTATION_LINK2}#why-are-my-tests-failing-in-different-environments`;
|
|
19
|
+
|
|
20
|
+
// src/constants.ts
|
|
21
|
+
var ADDON_ID3 = "storybook/test", TEST_PROVIDER_ID = `${ADDON_ID3}/test-provider`, STORYBOOK_ADDON_TEST_CHANNEL = "STORYBOOK_ADDON_TEST_CHANNEL";
|
|
22
|
+
var DOCUMENTATION_LINK3 = "writing-tests/integrations/vitest-addon", DOCUMENTATION_FATAL_ERROR_LINK = `${DOCUMENTATION_LINK3}#what-happens-if-vitest-itself-has-an-error`, COVERAGE_DIRECTORY = "coverage", SUPPORTED_FRAMEWORKS = [
|
|
23
|
+
"@storybook/nextjs",
|
|
24
|
+
"@storybook/nextjs-vite",
|
|
25
|
+
"@storybook/react-vite",
|
|
26
|
+
"@storybook/preact-vite",
|
|
27
|
+
"@storybook/svelte-vite",
|
|
28
|
+
"@storybook/vue3-vite",
|
|
29
|
+
"@storybook/html-vite",
|
|
30
|
+
"@storybook/web-components-vite",
|
|
31
|
+
"@storybook/sveltekit",
|
|
32
|
+
"@storybook/react-native-web-vite"
|
|
33
|
+
], storeOptions = {
|
|
34
|
+
id: ADDON_ID3,
|
|
35
|
+
initialState: {
|
|
36
|
+
config: {
|
|
37
|
+
coverage: !1,
|
|
38
|
+
a11y: !1
|
|
39
|
+
},
|
|
40
|
+
watching: !1,
|
|
41
|
+
cancelling: !1,
|
|
42
|
+
fatalError: void 0,
|
|
43
|
+
indexUrl: void 0,
|
|
44
|
+
previewAnnotations: [],
|
|
45
|
+
currentRun: {
|
|
46
|
+
triggeredBy: void 0,
|
|
47
|
+
config: {
|
|
48
|
+
coverage: !1,
|
|
49
|
+
a11y: !1
|
|
50
|
+
},
|
|
51
|
+
componentTestCount: {
|
|
52
|
+
success: 0,
|
|
53
|
+
error: 0
|
|
54
|
+
},
|
|
55
|
+
a11yCount: {
|
|
56
|
+
success: 0,
|
|
57
|
+
warning: 0,
|
|
58
|
+
error: 0
|
|
59
|
+
},
|
|
60
|
+
storyIds: void 0,
|
|
61
|
+
totalTestCount: void 0,
|
|
62
|
+
startedAt: void 0,
|
|
63
|
+
finishedAt: void 0,
|
|
64
|
+
unhandledErrors: [],
|
|
65
|
+
coverageSummary: void 0
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var STORE_CHANNEL_EVENT_NAME = `UNIVERSAL_STORE:${storeOptions.id}`, STATUS_STORE_CHANNEL_EVENT_NAME = "UNIVERSAL_STORE:storybook/status", TEST_PROVIDER_STORE_CHANNEL_EVENT_NAME = "UNIVERSAL_STORE:storybook/test-provider", STATUS_TYPE_ID_COMPONENT_TEST = "storybook/component-test", STATUS_TYPE_ID_A11Y = "storybook/a11y";
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
ADDON_ID3 as ADDON_ID,
|
|
73
|
+
STORYBOOK_ADDON_TEST_CHANNEL,
|
|
74
|
+
DOCUMENTATION_LINK3 as DOCUMENTATION_LINK,
|
|
75
|
+
COVERAGE_DIRECTORY,
|
|
76
|
+
SUPPORTED_FRAMEWORKS,
|
|
77
|
+
storeOptions,
|
|
78
|
+
STORE_CHANNEL_EVENT_NAME,
|
|
79
|
+
STATUS_STORE_CHANNEL_EVENT_NAME,
|
|
80
|
+
TEST_PROVIDER_STORE_CHANNEL_EVENT_NAME,
|
|
81
|
+
STATUS_TYPE_ID_COMPONENT_TEST,
|
|
82
|
+
STATUS_TYPE_ID_A11Y
|
|
83
|
+
};
|
|
@@ -1,40 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zfiyucf8tb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zfiyucf8tb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zfiyucf8tb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zfiyucf8tb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zfiyucf8tb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zfiyucf8tb.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
|
-
__commonJS
|
|
14
|
-
|
|
15
|
-
} from "./chunk-7J6TCEGO.js";
|
|
13
|
+
__commonJS
|
|
14
|
+
} from "./chunk-FCFZB5YS.js";
|
|
16
15
|
|
|
17
16
|
// ../../node_modules/picocolors/picocolors.js
|
|
18
17
|
var require_picocolors = __commonJS({
|
|
19
18
|
"../../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) => {
|
|
19
|
+
var p = process || {}, argv = p.argv || [], env = p.env || {}, 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), formatter = (open, close, replace = open) => (input) => {
|
|
25
20
|
let string = "" + input, index = string.indexOf(close, open.length);
|
|
26
21
|
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
27
|
-
},
|
|
28
|
-
var replaceClose = /* @__PURE__ */ __name((string, close, replace, index) => {
|
|
22
|
+
}, replaceClose = (string, close, replace, index) => {
|
|
29
23
|
let result = "", cursor = 0;
|
|
30
|
-
do
|
|
31
|
-
result += string.substring(cursor, index) + replace;
|
|
32
|
-
|
|
33
|
-
index = string.indexOf(close, cursor);
|
|
34
|
-
} while (~index);
|
|
24
|
+
do
|
|
25
|
+
result += string.substring(cursor, index) + replace, cursor = index + close.length, index = string.indexOf(close, cursor);
|
|
26
|
+
while (~index);
|
|
35
27
|
return result + string.substring(cursor);
|
|
36
|
-
},
|
|
37
|
-
var createColors = /* @__PURE__ */ __name((enabled = isColorSupported) => {
|
|
28
|
+
}, createColors = (enabled = isColorSupported) => {
|
|
38
29
|
let f = enabled ? formatter : () => String;
|
|
39
30
|
return {
|
|
40
31
|
isColorSupported: enabled,
|
|
@@ -80,7 +71,7 @@ var require_picocolors = __commonJS({
|
|
|
80
71
|
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
81
72
|
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
82
73
|
};
|
|
83
|
-
}
|
|
74
|
+
};
|
|
84
75
|
module.exports = createColors();
|
|
85
76
|
module.exports.createColors = createColors;
|
|
86
77
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "./_browser-chunks/chunk-JK72E6FR.js";
|
|
4
|
-
|
|
5
1
|
// src/index.ts
|
|
6
2
|
import { definePreviewAddon } from "storybook/internal/csf";
|
|
7
|
-
var index_default =
|
|
3
|
+
var index_default = () => definePreviewAddon({});
|
|
8
4
|
export {
|
|
9
5
|
index_default as default
|
|
10
6
|
};
|