@vitest/browser 4.1.1 → 4.1.3
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-C5TM4_dj.js → index-DflzHTY2.js} +27 -27
- package/dist/client/__vitest__/index.html +1 -1
- package/dist/client/__vitest_browser__/{orchestrator-DOndLT0I.js → orchestrator-DM4mHHP0.js} +1 -1
- package/dist/client/__vitest_browser__/{tester-FJ31y3VC.js → tester-DvOWMUmv.js} +9 -8
- package/dist/client/__vitest_browser__/{utils-Dsu9dGGg.js → utils-DmkAiRYk.js} +181 -163
- package/dist/client/error-catcher.js +1 -1
- package/dist/client/orchestrator.html +2 -2
- package/dist/client/tester/tester.html +2 -2
- package/dist/client.js +1 -1
- package/dist/expect-element.js +2 -2
- package/dist/index-C8KwPhQz.js +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4236 -5261
- package/dist/locators.d.ts +158 -229
- package/dist/locators.js +1 -1
- package/dist/shared/screenshotMatcher/types.d.ts +2 -0
- package/package.json +9 -9
- package/dist/index-5Pe7X7sp.js +0 -7
|
@@ -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-DflzHTY2.js"></script>
|
|
27
27
|
<link rel="stylesheet" href="./assets/index-Da0hb3oU.css">
|
|
28
28
|
</head>
|
|
29
29
|
<body>
|
package/dist/client/__vitest_browser__/{orchestrator-DOndLT0I.js → orchestrator-DM4mHHP0.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-DmkAiRYk.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-DmkAiRYk.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;
|
|
@@ -689,7 +689,9 @@ function createStackString(stacks) {
|
|
|
689
689
|
function parseStacktrace(stack, options = {}) {
|
|
690
690
|
const { ignoreStackEntries = stackIgnorePatterns } = options;
|
|
691
691
|
let stacks = !CHROME_IE_STACK_REGEXP.test(stack) ? parseFFOrSafariStackTrace(stack) : parseV8Stacktrace(stack);
|
|
692
|
-
const helperIndex = stacks.findLastIndex(
|
|
692
|
+
const helperIndex = stacks.findLastIndex(
|
|
693
|
+
(s) => s.method === "__VITEST_HELPER__" || s.method === "async*__VITEST_HELPER__" || s.method === "async __VITEST_HELPER__"
|
|
694
|
+
);
|
|
693
695
|
if (helperIndex >= 0) {
|
|
694
696
|
stacks = stacks.slice(helperIndex + 1);
|
|
695
697
|
}
|
|
@@ -911,13 +913,12 @@ function createBrowserRunner(runnerClass, mocker, state, coverageModule) {
|
|
|
911
913
|
}
|
|
912
914
|
};
|
|
913
915
|
onTaskFinished = async (task) => {
|
|
914
|
-
var _a, _b;
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
)) {
|
|
916
|
+
var _a, _b, _c, _d, _e, _f;
|
|
917
|
+
const lastErrorContext = (_c = (_b = (_a = task.result) == null ? void 0 : _a.errors) == null ? void 0 : _b.at(-1)) == null ? void 0 : _c.__vitest_error_context__;
|
|
918
|
+
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
919
|
const screenshot = await page.screenshot(
|
|
919
920
|
{
|
|
920
|
-
timeout: ((
|
|
921
|
+
timeout: ((_f = this.config.browser.providerOptions) == null ? void 0 : _f.actionTimeout) ?? 5e3
|
|
921
922
|
}
|
|
922
923
|
/** TODO */
|
|
923
924
|
).catch((err) => {
|