@storybook/addon-vitest 0.0.0-pr-32874-sha-fd398904 → 0.0.0-pr-32921-sha-16b7aab0
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-PMYV6BH2.js → chunk-RPDOPHZX.js} +1 -0
- package/dist/_node-chunks/{chunk-NQQ2WBZM.js → chunk-EYRCMB52.js} +7 -7
- package/dist/_node-chunks/{chunk-5EGXS55U.js → chunk-ITGNSETM.js} +7 -18
- package/dist/_node-chunks/chunk-IVUROXNL.js +348 -0
- package/dist/_node-chunks/chunk-RGV5SOPJ.js +40 -0
- package/dist/_node-chunks/{chunk-44SFLJBP.js → chunk-WPTT6UNN.js} +7 -7
- package/dist/_node-chunks/{chunk-LB44Z253.js → chunk-XJAFV5RM.js} +6 -6
- package/dist/_node-chunks/{chunk-ZIYTWRWN.js → chunk-YT4V4DMB.js} +7 -7
- package/dist/_node-chunks/chunk-ZJEXRKEJ.js +60 -0
- package/dist/manager.js +1 -1
- package/dist/node/coverage-reporter.js +8 -8
- package/dist/node/vitest.js +31 -17
- package/dist/postinstall.js +216 -431
- package/dist/preset.js +2239 -15
- package/dist/vitest-plugin/global-setup.js +7 -7
- package/dist/vitest-plugin/index.js +10 -9
- package/dist/vitest-plugin/setup-file.js +1 -1
- package/package.json +12 -10
- package/templates/vitest.config.3.2.template.ts +6 -1
- package/templates/vitest.config.4.template.ts +37 -0
- package/templates/vitest.config.template.ts +6 -1
- package/templates/vitest.workspace.template.ts +6 -1
- package/dist/_node-chunks/chunk-75RHCDJA.js +0 -2574
- package/dist/_node-chunks/chunk-A5KYOUXA.js +0 -37
- package/dist/_node-chunks/chunk-ATWWQSYY.js +0 -98
package/dist/node/vitest.js
CHANGED
|
@@ -1,38 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_6px7swmj8pe from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_6px7swmj8pe from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_6px7swmj8pe from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_6px7swmj8pe.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_6px7swmj8pe.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_6px7swmj8pe.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-RGV5SOPJ.js";
|
|
15
15
|
import {
|
|
16
|
-
any
|
|
17
|
-
|
|
18
|
-
} from "../_node-chunks/chunk-ATWWQSYY.js";
|
|
16
|
+
any
|
|
17
|
+
} from "../_node-chunks/chunk-ZJEXRKEJ.js";
|
|
19
18
|
import {
|
|
20
19
|
ADDON_ID,
|
|
21
20
|
COVERAGE_DIRECTORY,
|
|
22
21
|
STATUS_TYPE_ID_A11Y,
|
|
23
22
|
STATUS_TYPE_ID_COMPONENT_TEST,
|
|
24
23
|
storeOptions
|
|
25
|
-
} from "../_node-chunks/chunk-
|
|
26
|
-
import "../_node-chunks/chunk-
|
|
24
|
+
} from "../_node-chunks/chunk-ITGNSETM.js";
|
|
25
|
+
import "../_node-chunks/chunk-EYRCMB52.js";
|
|
27
26
|
import {
|
|
28
27
|
dirname,
|
|
29
28
|
join,
|
|
30
29
|
normalize,
|
|
31
30
|
path
|
|
32
|
-
} from "../_node-chunks/chunk-
|
|
31
|
+
} from "../_node-chunks/chunk-YT4V4DMB.js";
|
|
33
32
|
import {
|
|
34
33
|
__name
|
|
35
|
-
} from "../_node-chunks/chunk-
|
|
34
|
+
} from "../_node-chunks/chunk-XJAFV5RM.js";
|
|
36
35
|
|
|
37
36
|
// src/node/vitest.ts
|
|
38
37
|
import process2 from "node:process";
|
|
@@ -174,6 +173,18 @@ function throttle(func, throttleMs, { signal, edges = ["leading", "trailing"] }
|
|
|
174
173
|
}
|
|
175
174
|
__name(throttle, "throttle");
|
|
176
175
|
|
|
176
|
+
// src/utils.ts
|
|
177
|
+
function errorToErrorLike(error) {
|
|
178
|
+
return {
|
|
179
|
+
message: error.message,
|
|
180
|
+
name: error.name,
|
|
181
|
+
// avoid duplicating the error message in the stack trace
|
|
182
|
+
stack: error.stack?.replace(error.message, ""),
|
|
183
|
+
cause: error.cause && error.cause instanceof Error ? errorToErrorLike(error.cause) : void 0
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
__name(errorToErrorLike, "errorToErrorLike");
|
|
187
|
+
|
|
177
188
|
// src/node/vitest-manager.ts
|
|
178
189
|
import { existsSync } from "node:fs";
|
|
179
190
|
import { getProjectRoot, resolvePathInStorybookCache } from "storybook/internal/common";
|
|
@@ -234,7 +245,7 @@ var StorybookReporter = class {
|
|
|
234
245
|
this.ctx.state.pathsSet.clear();
|
|
235
246
|
this.ctx.state.idMap.clear();
|
|
236
247
|
this.ctx.state.errorsSet.clear();
|
|
237
|
-
this.ctx.state.processTimeoutCauses
|
|
248
|
+
this.ctx.state.processTimeoutCauses?.clear();
|
|
238
249
|
}
|
|
239
250
|
};
|
|
240
251
|
|
|
@@ -350,12 +361,15 @@ Please install the @vitest/${coveragePackage} package to collect coverage
|
|
|
350
361
|
this.vitest?.setGlobalTestNamePattern("");
|
|
351
362
|
}
|
|
352
363
|
updateLastChanged(filepath) {
|
|
353
|
-
|
|
354
|
-
projects.forEach(({ server, browser }) => {
|
|
364
|
+
this.vitest.projects.forEach(({ browser, vite, server }) => {
|
|
355
365
|
if (server) {
|
|
356
366
|
const serverMods = server.moduleGraph.getModulesByFile(filepath);
|
|
357
367
|
serverMods?.forEach((mod) => server.moduleGraph.invalidateModule(mod));
|
|
358
368
|
}
|
|
369
|
+
if (vite) {
|
|
370
|
+
const serverMods = vite.moduleGraph.getModulesByFile(filepath);
|
|
371
|
+
serverMods?.forEach((mod) => vite.moduleGraph.invalidateModule(mod));
|
|
372
|
+
}
|
|
359
373
|
if (browser) {
|
|
360
374
|
const browserMods = browser.vite.moduleGraph.getModulesByFile(filepath);
|
|
361
375
|
browserMods?.forEach((mod) => browser.vite.moduleGraph.invalidateModule(mod));
|