@vitest/browser 4.1.0 → 4.1.2
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/context.d.ts +2 -2
- package/dist/client/.vite/manifest.json +6 -6
- package/dist/client/__vitest__/assets/index-Dpc7kNBC.js +94 -0
- package/dist/client/__vitest__/index.html +1 -1
- package/dist/client/__vitest_browser__/{orchestrator-CXs6qrFe.js → orchestrator-BNCEhPrv.js} +1 -1
- package/dist/client/__vitest_browser__/{tester-K5NNxh1O.js → tester-CuvoYKLr.js} +6 -7
- package/dist/client/__vitest_browser__/utils-DCeMntTS.js +3829 -0
- package/dist/client/error-catcher.js +1 -1
- package/dist/client/esm-client-injector.js +3 -0
- package/dist/client/orchestrator.html +2 -2
- package/dist/client/tester/tester.html +2 -2
- package/dist/client.js +1 -1
- package/dist/context.js +9 -2
- package/dist/expect-element.js +1 -1
- package/dist/index.js +19 -8
- package/dist/shared/screenshotMatcher/types.d.ts +2 -0
- package/package.json +8 -8
- package/dist/client/__vitest__/assets/index-Di71CKDo.js +0 -63
- package/dist/client/__vitest_browser__/utils-C2ISqq1C.js +0 -223
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
})();
|
|
24
24
|
</script>
|
|
25
25
|
<!-- !LOAD_METADATA! -->
|
|
26
|
-
<script type="module" src="./assets/index-
|
|
26
|
+
<script type="module" src="./assets/index-Dpc7kNBC.js"></script>
|
|
27
27
|
<link rel="stylesheet" href="./assets/index-Da0hb3oU.css">
|
|
28
28
|
</head>
|
|
29
29
|
<body>
|
package/dist/client/__vitest_browser__/{orchestrator-CXs6qrFe.js → orchestrator-BNCEhPrv.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getBrowserState, a as getConfig, r as relative, b as generateFileHash } from "./utils-
|
|
1
|
+
import { g as getBrowserState, a as getConfig, r as relative, b as generateFileHash } from "./utils-DCeMntTS.js";
|
|
2
2
|
import { channel, globalChannel, client } from "@vitest/browser/client";
|
|
3
3
|
import { Traces } from "vitest/internal/browser";
|
|
4
4
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as resolve, m as moduleRunner, d as getWorkerState, g as getBrowserState, e as getTestName, a as getConfig } from "./utils-
|
|
1
|
+
import { c as resolve, m as moduleRunner, d as getWorkerState, g as getBrowserState, e as getTestName, a as getConfig } from "./utils-DCeMntTS.js";
|
|
2
2
|
import { onCancel, globalChannel, channel, client } from "@vitest/browser/client";
|
|
3
3
|
import { userEvent, page, server } from "vitest/browser";
|
|
4
4
|
import { getSafeTimers, DecodedMap as DecodedMap$1, getOriginalPosition as getOriginalPosition$1, loadDiffConfig, loadSnapshotSerializers, takeCoverageInsideWorker, browserFormat, Traces, setupCommonEnv, startCoverageInsideWorker, stopCoverageInsideWorker, startTests, collectTests, SpyModule } from "vitest/internal/browser";
|
|
@@ -71,7 +71,7 @@ const resolver = (input, lazy, parsed, $) => (output) => {
|
|
|
71
71
|
const k = ke[y];
|
|
72
72
|
const value = output[k];
|
|
73
73
|
if (value instanceof Primitive) {
|
|
74
|
-
const tmp = input[value];
|
|
74
|
+
const tmp = input[+value];
|
|
75
75
|
if (typeof tmp === object && !parsed.has(tmp)) {
|
|
76
76
|
parsed.add(tmp);
|
|
77
77
|
output[k] = ignore;
|
|
@@ -911,13 +911,12 @@ function createBrowserRunner(runnerClass, mocker, state, coverageModule) {
|
|
|
911
911
|
}
|
|
912
912
|
};
|
|
913
913
|
onTaskFinished = async (task) => {
|
|
914
|
-
var _a, _b;
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
)) {
|
|
914
|
+
var _a, _b, _c, _d, _e, _f;
|
|
915
|
+
const lastErrorContext = (_c = (_b = (_a = task.result) == null ? void 0 : _a.errors) == null ? void 0 : _b.at(-1)) == null ? void 0 : _c.context;
|
|
916
|
+
if (this.config.browser.screenshotFailures && document.body.clientHeight > 0 && ((_d = task.result) == null ? void 0 : _d.state) === "fail" && task.type === "test" && !(lastErrorContext && Reflect.get(lastErrorContext, "assertionName") === "toMatchScreenshot" && ((_e = Reflect.get(lastErrorContext, "meta")) == null ? void 0 : _e.outcome) !== "unstable-screenshot")) {
|
|
918
917
|
const screenshot = await page.screenshot(
|
|
919
918
|
{
|
|
920
|
-
timeout: ((
|
|
919
|
+
timeout: ((_f = this.config.browser.providerOptions) == null ? void 0 : _f.actionTimeout) ?? 5e3
|
|
921
920
|
}
|
|
922
921
|
/** TODO */
|
|
923
922
|
).catch((err) => {
|