@voidzero-dev/vite-plus-test 0.1.9 → 0.1.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/LICENSE.md +181 -1
- package/dist/@vitest/browser/client/.vite/manifest.json +6 -6
- package/dist/@vitest/browser/client/__vitest__/assets/index-Da0hb3oU.css +1 -0
- package/dist/@vitest/browser/client/__vitest__/assets/index-Di71CKDo.js +63 -0
- package/dist/@vitest/browser/client/__vitest__/favicon.ico +0 -0
- package/dist/@vitest/browser/client/__vitest__/favicon.svg +49 -4
- package/dist/@vitest/browser/client/__vitest__/index.html +2 -2
- package/dist/@vitest/browser/client/__vitest_browser__/{orchestrator-S_3e_uzt.js → orchestrator-CXs6qrFe.js} +70 -28
- package/dist/@vitest/browser/client/__vitest_browser__/{tester-k74mgIRa.js → tester-K5NNxh1O.js} +168 -59
- package/dist/@vitest/browser/client/__vitest_browser__/{utils-uxqdqUz8.js → utils-C2ISqq1C.js} +2 -2
- package/dist/@vitest/browser/client/favicon.svg +49 -4
- package/dist/@vitest/browser/client/orchestrator.html +2 -2
- package/dist/@vitest/browser/client/tester/tester.html +2 -2
- package/dist/@vitest/browser/client.js +20 -13
- package/dist/@vitest/browser/context.d.ts +160 -10
- package/dist/@vitest/browser/context.js +108 -22
- package/dist/@vitest/browser/expect-element.js +23 -28
- package/dist/@vitest/browser/index-5Pe7X7sp.js +7 -0
- package/dist/@vitest/browser/index.d.ts +20 -2
- package/dist/@vitest/browser/index.js +5706 -159
- package/dist/@vitest/browser/locators.d.ts +14 -3
- package/dist/@vitest/browser/locators.js +1 -1
- package/dist/@vitest/browser-playwright/index.d.ts +23 -6
- package/dist/@vitest/browser-playwright/index.js +169 -61
- package/dist/@vitest/browser-playwright/locators.js +1 -1
- package/dist/@vitest/browser-preview/index.d.ts +14 -1
- package/dist/@vitest/browser-preview/locators.js +32 -20
- package/dist/@vitest/browser-webdriverio/index.d.ts +17 -3
- package/dist/@vitest/browser-webdriverio/index.js +22 -2
- package/dist/@vitest/browser-webdriverio/locators.js +85 -9
- package/dist/@vitest/expect/index.d.ts +172 -54
- package/dist/@vitest/expect/index.js +124 -67
- package/dist/@vitest/mocker/auto-register.js +1 -0
- package/dist/@vitest/mocker/automock.d.ts +1 -0
- package/dist/@vitest/mocker/automock.js +5 -0
- package/dist/@vitest/mocker/browser.d.ts +4 -4
- package/dist/@vitest/mocker/browser.js +1 -0
- package/dist/@vitest/mocker/chunk-automock.js +182 -14
- package/dist/@vitest/mocker/chunk-helpers.js +44 -0
- package/dist/@vitest/mocker/chunk-hoistMocks.js +659 -0
- package/dist/@vitest/mocker/chunk-mocker.js +41 -30
- package/dist/@vitest/mocker/chunk-registry.js +21 -7
- package/dist/@vitest/mocker/chunk-utils.js +18 -7
- package/dist/@vitest/mocker/hoistMocks.d-w2ILr1dG.d.ts +739 -0
- package/dist/@vitest/mocker/{index.d-C-sLYZi-.d.ts → index.d-B41z0AuW.d.ts} +1 -1
- package/dist/@vitest/mocker/index.d.ts +2 -2
- package/dist/@vitest/mocker/index.js +18 -3
- package/dist/@vitest/mocker/{mocker.d-TnKRhz7N.d.ts → mocker.d-QEntlm6J.d.ts} +10 -5
- package/dist/@vitest/mocker/node.d.ts +5 -734
- package/dist/@vitest/mocker/node.js +29 -587
- package/dist/@vitest/mocker/redirect.js +4 -4
- package/dist/@vitest/mocker/register.d.ts +3 -3
- package/dist/@vitest/mocker/register.js +1 -0
- package/dist/@vitest/mocker/transforms.d.ts +6 -0
- package/dist/@vitest/mocker/transforms.js +8 -0
- package/dist/@vitest/mocker/{types.d-B8CCKmHt.d.ts → types.d-BjI5eAwu.d.ts} +23 -7
- package/dist/@vitest/pretty-format/index.d.ts +11 -1
- package/dist/@vitest/pretty-format/index.js +33 -4
- package/dist/@vitest/runner/chunk-tasks.js +305 -37
- package/dist/@vitest/runner/index.d.ts +5 -6
- package/dist/@vitest/runner/index.js +1146 -455
- package/dist/@vitest/runner/{tasks.d-C7UxawJ9.d.ts → tasks.d-D2GKpdwQ.d.ts} +726 -55
- package/dist/@vitest/runner/types.d.ts +2 -182
- package/dist/@vitest/runner/utils.d.ts +16 -8
- package/dist/@vitest/runner/utils.js +1 -1
- package/dist/@vitest/snapshot/{environment.d-DHdQ1Csl.d.ts → environment.d-DOJxxZV9.d.ts} +2 -7
- package/dist/@vitest/snapshot/environment.d.ts +2 -1
- package/dist/@vitest/snapshot/environment.js +1 -1
- package/dist/@vitest/snapshot/index.d.ts +4 -3
- package/dist/@vitest/snapshot/index.js +21 -550
- package/dist/@vitest/snapshot/manager.d.ts +3 -2
- package/dist/@vitest/snapshot/manager.js +1 -1
- package/dist/@vitest/snapshot/{rawSnapshot.d-lFsMJFUd.d.ts → rawSnapshot.d-U2kJUxDr.d.ts} +1 -1
- package/dist/@vitest/spy/index.d.ts +34 -4
- package/dist/@vitest/spy/index.js +69 -19
- package/dist/@vitest/utils/diff.js +11 -9
- package/dist/@vitest/utils/display.d.ts +2 -1
- package/dist/@vitest/utils/display.js +38 -5
- package/dist/@vitest/utils/error.d.ts +2 -1
- package/dist/@vitest/utils/error.js +1 -2
- package/dist/@vitest/utils/helpers.d.ts +4 -1
- package/dist/@vitest/utils/helpers.js +43 -1
- package/dist/@vitest/utils/resolver.js +1 -2
- package/dist/@vitest/utils/serialize.js +6 -6
- package/dist/@vitest/utils/source-map/node.d.ts +6 -0
- package/dist/@vitest/utils/source-map/node.js +23 -0
- package/dist/@vitest/utils/source-map.js +15 -5
- package/dist/browser.d.ts +3 -2
- package/dist/browser.js +2 -2
- package/dist/chunks/acorn.B2iPLyUM.js +5958 -0
- package/dist/chunks/{base.CJ0Y4ePK.js → base.DM0-RqVb.js} +54 -16
- package/dist/chunks/{benchmark.B3N2zMcH.js → benchmark.D0SlKNbZ.js} +1 -1
- package/dist/chunks/{browser.d.ChKACdzH.d.ts → browser.d.X3SXoOCV.d.ts} +4 -1
- package/dist/chunks/{cac.DVeoLl0M.js → cac.CWGDZnXT.js} +979 -20
- package/dist/chunks/{cli-api.B7PN_QUv.js → cli-api.DuT9iuvY.js} +8764 -7898
- package/dist/chunks/{config.d.Cy95HiCx.d.ts → config.d.EJLVE3es.d.ts} +30 -15
- package/dist/chunks/{console.Cf-YriPC.js → console.3WNpx0tS.js} +3 -2
- package/dist/chunks/{constants.D_Q9UYh-.js → constants.CPYnjOGj.js} +4 -2
- package/dist/chunks/coverage.Bri33R1t.js +1050 -0
- package/dist/chunks/{creator.DAmOKTvJ.js → creator.DgVhQm5q.js} +35 -4
- package/dist/chunks/{defaults.BOqNVLsY.js → defaults.CdU2lD-q.js} +4 -3
- package/dist/chunks/{global.d.B15mdLcR.d.ts → global.d.x-ILCfAE.d.ts} +1 -2
- package/dist/chunks/{globals.DOayXfHP.js → globals.BXNGLnTL.js} +11 -10
- package/dist/chunks/{coverage.AVPTjMgw.js → index.BCY_7LL2.js} +5 -959
- package/dist/chunks/{index.C5r1PdPD.js → index.CEzQDJGb.js} +1 -1
- package/dist/chunks/{index.D3XRDfWc.js → index.CMESou6r.js} +26 -1
- package/dist/chunks/{index.6Qv1eEA6.js → index.DGNSnENe.js} +95 -9
- package/dist/chunks/{index.M8mOzt4Y.js → index.DXMFO5MJ.js} +3279 -2914
- package/dist/chunks/{index.Z5E_ObnR.js → index.DlDSLQD3.js} +7 -3
- package/dist/chunks/{index.CyBMJtT7.js → index.EY6TCHpo.js} +10 -8
- package/dist/chunks/{index.D4KonVSU.js → index.og1WyBLx.js} +18 -3
- package/dist/chunks/{init-forks._y3TW739.js → init-forks.DeArv0jT.js} +1 -1
- package/dist/chunks/{init-threads.DBO2kn-p.js → init-threads.-2OUl4Nn.js} +1 -1
- package/dist/chunks/{init.B6MLFIaN.js → init.DICorXCo.js} +52 -13
- package/dist/chunks/native.DPzPHdi5.js +148 -0
- package/dist/chunks/nativeModuleMocker.DndvSdL6.js +206 -0
- package/dist/chunks/nativeModuleRunner.BIakptoF.js +36 -0
- package/dist/chunks/{node.Ce0vMQM7.js → node.COQbm6gK.js} +1 -1
- package/dist/chunks/{plugin.d.CtqpEehP.d.ts → plugin.d.BuW-flqo.d.ts} +1 -1
- package/dist/chunks/{reporters.d.CWXNI2jG.d.ts → reporters.d.DVUYHHhe.d.ts} +328 -79
- package/dist/chunks/rpc.MzXet3jl.js +144 -0
- package/dist/chunks/{rpc.d.RH3apGEf.d.ts → rpc.d.BFMWpdph.d.ts} +10 -2
- package/dist/chunks/{setup-common.Cm-kSBVi.js → setup-common.B41N_kPE.js} +3 -3
- package/dist/chunks/{startModuleRunner.DEj0jb3e.js → startVitestModuleRunner.C3ZR-4J3.js} +265 -405
- package/dist/chunks/{suite.d.BJWk38HB.d.ts → suite.d.udJtyAgw.d.ts} +1 -1
- package/dist/chunks/{vi.2VT5v0um.js → test.CTcmp4Su.js} +538 -181
- package/dist/chunks/{utils.DvEY5TfP.js → utils.BX5Fg8C4.js} +8 -1
- package/dist/chunks/{vm.D3epNOPZ.js → vm.Dh2rTtmP.js} +48 -8
- package/dist/chunks/{worker.d.Dyxm8DEL.d.ts → worker.d.B84sVRy0.d.ts} +2 -2
- package/dist/cli.js +6 -5
- package/dist/client/.vite/manifest.json +6 -6
- package/dist/client/__vitest__/assets/index-Da0hb3oU.css +1 -0
- package/dist/client/__vitest__/assets/index-Di71CKDo.js +63 -0
- package/dist/client/__vitest__/favicon.ico +0 -0
- package/dist/client/__vitest__/favicon.svg +49 -4
- package/dist/client/__vitest__/index.html +2 -2
- package/dist/client/__vitest_browser__/{orchestrator-S_3e_uzt.js → orchestrator-CXs6qrFe.js} +70 -28
- package/dist/client/__vitest_browser__/{tester-k74mgIRa.js → tester-K5NNxh1O.js} +167 -58
- package/dist/client/__vitest_browser__/{utils-uxqdqUz8.js → utils-C2ISqq1C.js} +2 -2
- package/dist/client/favicon.svg +49 -4
- package/dist/client/orchestrator.html +2 -2
- package/dist/client/tester/tester.html +2 -2
- package/dist/client.js +20 -13
- package/dist/config.cjs +3 -2
- package/dist/config.d.ts +13 -12
- package/dist/config.js +2 -2
- package/dist/context.js +108 -22
- package/dist/coverage.d.ts +12 -8
- package/dist/coverage.js +8 -5
- package/dist/environments.js +3 -1
- package/dist/expect-element.js +23 -23
- package/dist/index-5Pe7X7sp.js +7 -0
- package/dist/index.d.ts +66 -27
- package/dist/index.js +10 -9
- package/dist/locators.d.ts +14 -3
- package/dist/locators.js +1 -1
- package/dist/module-evaluator.d.ts +11 -1
- package/dist/module-evaluator.js +43 -26
- package/dist/node.d.ts +28 -14
- package/dist/node.js +42 -40
- package/dist/nodejs-worker-loader.js +41 -0
- package/dist/plugins/mocker-transforms.mjs +2 -0
- package/dist/plugins/utils-source-map-node.mjs +2 -0
- package/dist/reporters.d.ts +8 -8
- package/dist/reporters.js +7 -5
- package/dist/runners.d.ts +24 -5
- package/dist/runners.js +6 -6
- package/dist/runtime.d.ts +6 -0
- package/dist/runtime.js +35 -0
- package/dist/snapshot.js +4 -2
- package/dist/suite.d.ts +1 -1
- package/dist/suite.js +4 -2
- package/dist/vendor/blazediff_core.d.mts +1 -0
- package/dist/vendor/blazediff_core.mjs +117 -0
- package/dist/vendor/chai.mjs +4 -249
- package/dist/vendor/convert-source-map.d.mts +1 -0
- package/dist/vendor/convert-source-map.mjs +150 -0
- package/dist/vendor/expect-type.d.mts +14 -7
- package/dist/vendor/expect-type.mjs +5 -5
- package/dist/vendor/std-env.d.mts +131 -40
- package/dist/vendor/std-env.mjs +114 -117
- package/dist/worker.d.ts +6 -6
- package/dist/worker.js +27 -21
- package/dist/workers/forks.js +23 -17
- package/dist/workers/runVmTests.js +18 -16
- package/dist/workers/threads.js +23 -17
- package/dist/workers/vmForks.js +15 -12
- package/dist/workers/vmThreads.js +15 -12
- package/globals.d.ts +2 -0
- package/package.json +35 -26
- package/suppress-warnings.cjs +1 -0
- package/dist/@vitest/browser/client/__vitest__/assets/index-BUCFJtth.js +0 -57
- package/dist/@vitest/browser/client/__vitest__/assets/index-DlhE0rqZ.css +0 -1
- package/dist/@vitest/browser/index-D6m36C6U.js +0 -11
- package/dist/@vitest/utils/chunk-_commonjsHelpers.js +0 -5
- package/dist/@vitest/utils/highlight.d.ts +0 -9
- package/dist/@vitest/utils/highlight.js +0 -538
- package/dist/chunks/date.Bq6ZW5rf.js +0 -73
- package/dist/chunks/rpc.BoxB0q7B.js +0 -76
- package/dist/chunks/test.B8ej_ZHS.js +0 -254
- package/dist/client/__vitest__/assets/index-BUCFJtth.js +0 -57
- package/dist/client/__vitest__/assets/index-DlhE0rqZ.css +0 -1
- package/dist/index-D6m36C6U.js +0 -6
- package/dist/mocker.d.ts +0 -1
- package/dist/mocker.js +0 -1
- package/dist/module-runner.js +0 -17
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { isBuiltin } from 'node:module';
|
|
2
|
+
|
|
3
|
+
let port;
|
|
4
|
+
const initialize = async ({ port: _port, time: _time }) => {
|
|
5
|
+
port = _port;
|
|
6
|
+
};
|
|
7
|
+
const NOW_LENGTH = Date.now().toString().length;
|
|
8
|
+
const REGEXP_VITEST = new RegExp(`%3Fvitest=\\d{${NOW_LENGTH}}`);
|
|
9
|
+
const REGEXP_MOCK_ACTUAL = /\?mock=actual/;
|
|
10
|
+
const resolve = (specifier, context, defaultResolve) => {
|
|
11
|
+
if (specifier.includes("mock=actual")) {
|
|
12
|
+
// url is already resolved by `importActual`
|
|
13
|
+
const moduleId = specifier.replace(REGEXP_MOCK_ACTUAL, "");
|
|
14
|
+
return {
|
|
15
|
+
url: moduleId,
|
|
16
|
+
format: isBuiltin(moduleId) ? "builtin" : void 0,
|
|
17
|
+
shortCircuit: true
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const isVitest = specifier.includes("%3Fvitest=");
|
|
21
|
+
const result = defaultResolve(isVitest ? specifier.replace(REGEXP_VITEST, "") : specifier, context);
|
|
22
|
+
if (!port || !context?.parentURL) return result;
|
|
23
|
+
if (typeof result === "object" && "then" in result) return result.then((resolved) => {
|
|
24
|
+
ensureModuleGraphEntry(resolved.url, context.parentURL);
|
|
25
|
+
if (isVitest) resolved.url = `${resolved.url}?vitest=${Date.now()}`;
|
|
26
|
+
return resolved;
|
|
27
|
+
});
|
|
28
|
+
if (isVitest) result.url = `${result.url}?vitest=${Date.now()}`;
|
|
29
|
+
ensureModuleGraphEntry(result.url, context.parentURL);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
function ensureModuleGraphEntry(url, parentURL) {
|
|
33
|
+
if (url.includes("/node_modules/")) return;
|
|
34
|
+
port.postMessage({
|
|
35
|
+
event: "register-module-graph-entry",
|
|
36
|
+
url,
|
|
37
|
+
parentURL
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { initialize, resolve };
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { m as AgentReporter, n as BaseReporter, o as BenchmarkBuiltinReporters, p as BenchmarkReporter, q as BenchmarkReportsMap, M as BuiltinReporterOptions, N as BuiltinReporters, $ as DefaultReporter, a1 as DotReporter, a3 as GithubActionsReporter, a5 as HangingProcessReporter, a7 as JUnitReporter, a8 as JsonAssertionResult, aa as JsonReporter, ab as JsonTestResult, ac as JsonTestResults, an as ReportedHookContext, ao as Reporter, ap as ReportersMap, av as TapFlatReporter, aw as TapReporter, aH as TestRunEndReason, aR as VerboseBenchmarkReporter, aS as VerboseReporter } from './chunks/reporters.d.DVUYHHhe.js';
|
|
2
2
|
import './@vitest/runner/index.js';
|
|
3
3
|
import './@vitest/utils/index.js';
|
|
4
|
-
import './chunks/rpc.d.
|
|
4
|
+
import './chunks/rpc.d.BFMWpdph.js';
|
|
5
5
|
import './@vitest/snapshot/index.js';
|
|
6
6
|
import '@voidzero-dev/vite-plus-core/module-runner';
|
|
7
7
|
import './chunks/traces.d.402V_yFI.js';
|
|
8
8
|
import 'node:stream';
|
|
9
9
|
import '@voidzero-dev/vite-plus-core';
|
|
10
|
-
import './chunks/browser.d.
|
|
11
|
-
import './chunks/worker.d.
|
|
12
|
-
import './chunks/config.d.
|
|
10
|
+
import './chunks/browser.d.X3SXoOCV.js';
|
|
11
|
+
import './chunks/worker.d.B84sVRy0.js';
|
|
12
|
+
import './chunks/config.d.EJLVE3es.js';
|
|
13
13
|
import './@vitest/pretty-format/index.js';
|
|
14
14
|
import './@vitest/utils/diff.js';
|
|
15
15
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
16
|
-
import './@vitest/mocker/index.js';
|
|
17
|
-
import './@vitest/utils/source-map.js';
|
|
18
|
-
import './@vitest/browser/index.js';
|
|
19
16
|
import './@vitest/expect/index.js';
|
|
20
17
|
import 'vitest/optional-types.js';
|
|
21
18
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
22
19
|
import './@vitest/runner/utils.js';
|
|
23
20
|
import './vendor/tinybench.mjs';
|
|
21
|
+
import './@vitest/mocker/index.js';
|
|
22
|
+
import './@vitest/utils/source-map.js';
|
|
23
|
+
import './@vitest/browser/index.js';
|
|
24
24
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
25
25
|
import './@vitest/snapshot/manager.js';
|
|
26
26
|
import 'node:console';
|
package/dist/reporters.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter,
|
|
2
|
-
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.
|
|
1
|
+
export { A as AgentReporter, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, J as JUnitReporter, b as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.DXMFO5MJ.js';
|
|
2
|
+
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.CEzQDJGb.js';
|
|
3
3
|
import 'node:fs';
|
|
4
|
-
import 'node:fs/promises';
|
|
5
|
-
import './vendor/pathe.mjs';
|
|
6
4
|
import 'node:perf_hooks';
|
|
7
5
|
import './@vitest/runner/utils.js';
|
|
8
6
|
import './@vitest/utils/helpers.js';
|
|
9
7
|
import './@vitest/utils/source-map.js';
|
|
8
|
+
import './vendor/pathe.mjs';
|
|
10
9
|
import './vendor/tinyrainbow.mjs';
|
|
11
10
|
import './chunks/env.D4Lgay0q.js';
|
|
12
11
|
import './vendor/std-env.mjs';
|
|
13
|
-
import 'node:util';
|
|
14
12
|
import 'node:console';
|
|
15
13
|
import 'node:stream';
|
|
14
|
+
import 'node:util';
|
|
16
15
|
import './@vitest/utils/display.js';
|
|
17
16
|
import 'node:os';
|
|
18
17
|
import './vendor/tinyexec.mjs';
|
|
@@ -21,4 +20,7 @@ import 'node:path';
|
|
|
21
20
|
import 'node:url';
|
|
22
21
|
import '@voidzero-dev/vite-plus-core';
|
|
23
22
|
import './@vitest/utils/offset.js';
|
|
23
|
+
import 'node:fs/promises';
|
|
24
24
|
import 'node:module';
|
|
25
|
+
|
|
26
|
+
console.warn("Importing from \"vitest/reporters\" is deprecated since Vitest 4.1. Please use \"vitest/node\" instead.");
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as tinybench from './vendor/tinybench.mjs';
|
|
2
|
-
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TestContext, ImportDuration } from './@vitest/runner/index.js';
|
|
2
|
+
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TestContext, ImportDuration, createTaskCollector, getCurrentSuite, getCurrentTest, getHooks, getFn } from './@vitest/runner/index.js';
|
|
3
3
|
export { VitestRunner } from './@vitest/runner/index.js';
|
|
4
|
-
import { S as SerializedConfig } from './chunks/config.d.
|
|
4
|
+
import { S as SerializedConfig } from './chunks/config.d.EJLVE3es.js';
|
|
5
5
|
import { T as Traces } from './chunks/traces.d.402V_yFI.js';
|
|
6
|
+
import { createChainable } from './@vitest/runner/utils.js';
|
|
7
|
+
import { g as getBenchFn, a as getBenchOptions } from './chunks/suite.d.udJtyAgw.js';
|
|
6
8
|
import './@vitest/pretty-format/index.js';
|
|
7
9
|
import './@vitest/snapshot/index.js';
|
|
8
10
|
import './@vitest/utils/diff.js';
|
|
11
|
+
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
9
12
|
|
|
10
13
|
declare class NodeBenchmarkRunner implements VitestRunner {
|
|
11
14
|
config: SerializedConfig;
|
|
@@ -17,7 +20,7 @@ declare class NodeBenchmarkRunner implements VitestRunner {
|
|
|
17
20
|
runTask(): Promise<void>;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
declare class
|
|
23
|
+
declare class TestRunner implements VitestRunner {
|
|
21
24
|
config: SerializedConfig;
|
|
22
25
|
private snapshotClient;
|
|
23
26
|
private workerState;
|
|
@@ -27,12 +30,12 @@ declare class VitestTestRunner implements VitestRunner {
|
|
|
27
30
|
pool: string;
|
|
28
31
|
private _otel;
|
|
29
32
|
viteEnvironment: string;
|
|
33
|
+
private viteModuleRunner;
|
|
30
34
|
constructor(config: SerializedConfig);
|
|
31
35
|
importFile(filepath: string, source: VitestRunnerImportSource): unknown;
|
|
32
36
|
onCollectStart(file: File): void;
|
|
33
37
|
onCleanupWorkerContext(listener: () => unknown): void;
|
|
34
38
|
onAfterRunFiles(): void;
|
|
35
|
-
getWorkerContext(): Record<string, unknown>;
|
|
36
39
|
onAfterRunSuite(suite: Suite): Promise<void>;
|
|
37
40
|
onAfterRunTask(test: Task): void;
|
|
38
41
|
cancel(_reason: CancelReason): void;
|
|
@@ -45,6 +48,22 @@ declare class VitestTestRunner implements VitestRunner {
|
|
|
45
48
|
getImportDurations(): Record<string, ImportDuration>;
|
|
46
49
|
trace: <T>(name: string, attributes: Record<string, any> | (() => T), cb?: () => T) => T;
|
|
47
50
|
__setTraces(traces: Traces): void;
|
|
51
|
+
static createTaskCollector: typeof createTaskCollector;
|
|
52
|
+
static getCurrentSuite: typeof getCurrentSuite;
|
|
53
|
+
static getCurrentTest: typeof getCurrentTest;
|
|
54
|
+
static createChainable: typeof createChainable;
|
|
55
|
+
static getSuiteHooks: typeof getHooks;
|
|
56
|
+
static getTestFn: typeof getFn;
|
|
57
|
+
static setSuiteHooks: typeof getHooks;
|
|
58
|
+
static setTestFn: typeof getFn;
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated
|
|
61
|
+
*/
|
|
62
|
+
static getBenchFn: typeof getBenchFn;
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated
|
|
65
|
+
*/
|
|
66
|
+
static getBenchOptions: typeof getBenchOptions;
|
|
48
67
|
}
|
|
49
68
|
|
|
50
|
-
export { NodeBenchmarkRunner, VitestTestRunner };
|
|
69
|
+
export { NodeBenchmarkRunner, TestRunner as VitestTestRunner };
|
package/dist/runners.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { N as NodeBenchmarkRunner,
|
|
1
|
+
export { N as NodeBenchmarkRunner, T as VitestTestRunner } from './chunks/test.CTcmp4Su.js';
|
|
2
2
|
import './@vitest/runner/index.js';
|
|
3
3
|
import './@vitest/utils/helpers.js';
|
|
4
4
|
import './@vitest/utils/timers.js';
|
|
5
|
-
import './chunks/benchmark.
|
|
5
|
+
import './chunks/benchmark.D0SlKNbZ.js';
|
|
6
6
|
import './@vitest/runner/utils.js';
|
|
7
|
-
import './chunks/utils.
|
|
7
|
+
import './chunks/utils.BX5Fg8C4.js';
|
|
8
8
|
import './@vitest/expect/index.js';
|
|
9
9
|
import './@vitest/utils/error.js';
|
|
10
10
|
import './vendor/pathe.mjs';
|
|
11
|
-
import './chunks/vi.2VT5v0um.js';
|
|
12
11
|
import './@vitest/snapshot/index.js';
|
|
13
12
|
import './@vitest/spy/index.js';
|
|
14
13
|
import './@vitest/utils/offset.js';
|
|
15
14
|
import './@vitest/utils/source-map.js';
|
|
16
15
|
import './chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
17
|
-
import './chunks/
|
|
18
|
-
import './chunks/rpc.BoxB0q7B.js';
|
|
16
|
+
import './chunks/rpc.MzXet3jl.js';
|
|
19
17
|
import './chunks/index.Chj8NDwU.js';
|
|
18
|
+
|
|
19
|
+
console.warn("Importing from \"vitest/runners\" is deprecated since Vitest 4.1. Please use \"vitest\" instead.");
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { builtinEnvironments, populateGlobal } from './environments.js';
|
|
2
|
+
export { VitestSnapshotEnvironment } from './snapshot.js';
|
|
3
|
+
export { E as Environment, a as EnvironmentReturn, V as VmEnvironmentReturn } from './chunks/environment.d.CrsxCzP1.js';
|
|
4
|
+
export { VitestRunner, VitestRunnerConfig } from './@vitest/runner/index.js';
|
|
5
|
+
export { SnapshotEnvironment } from './@vitest/snapshot/environment.js';
|
|
6
|
+
import './@vitest/utils/index.js';
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { VitestModuleEvaluator } from './module-evaluator.js';
|
|
2
|
+
import { V as VITEST_VM_CONTEXT_SYMBOL, s as startVitestModuleRunner, a as VitestModuleRunner } from './chunks/startVitestModuleRunner.C3ZR-4J3.js';
|
|
3
|
+
import { g as getWorkerState } from './chunks/utils.BX5Fg8C4.js';
|
|
4
|
+
export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.EY6TCHpo.js';
|
|
5
|
+
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.COQbm6gK.js';
|
|
6
|
+
import 'node:module';
|
|
7
|
+
import 'node:url';
|
|
8
|
+
import 'node:vm';
|
|
9
|
+
import '@voidzero-dev/vite-plus-core/module-runner';
|
|
10
|
+
import './chunks/traces.CCmnQaNT.js';
|
|
11
|
+
import 'node:fs';
|
|
12
|
+
import './@vitest/utils/helpers.js';
|
|
13
|
+
import './chunks/modules.BJuCwlRJ.js';
|
|
14
|
+
import './vendor/pathe.mjs';
|
|
15
|
+
import './path.js';
|
|
16
|
+
import 'node:path';
|
|
17
|
+
import './@vitest/mocker/index.js';
|
|
18
|
+
import './@vitest/mocker/redirect.js';
|
|
19
|
+
import './@vitest/utils/timers.js';
|
|
20
|
+
import 'node:console';
|
|
21
|
+
import './@vitest/snapshot/environment.js';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
const __INTERNAL = {
|
|
27
|
+
VitestModuleEvaluator,
|
|
28
|
+
VitestModuleRunner,
|
|
29
|
+
startVitestModuleRunner,
|
|
30
|
+
VITEST_VM_CONTEXT_SYMBOL,
|
|
31
|
+
getWorkerState
|
|
32
|
+
};
|
|
33
|
+
// #endregion
|
|
34
|
+
|
|
35
|
+
export { __INTERNAL };
|
package/dist/snapshot.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.
|
|
1
|
+
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.COQbm6gK.js';
|
|
2
2
|
import './@vitest/snapshot/environment.js';
|
|
3
|
-
import './chunks/utils.
|
|
3
|
+
import './chunks/utils.BX5Fg8C4.js';
|
|
4
4
|
import './@vitest/utils/timers.js';
|
|
5
|
+
|
|
6
|
+
console.warn("Importing from \"vitest/snapshot\" is deprecated since Vitest 4.1. Please use \"vitest/runtime\" instead.");
|
package/dist/suite.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as getBenchFn, a as getBenchOptions } from './chunks/suite.d.
|
|
1
|
+
export { g as getBenchFn, a as getBenchOptions } from './chunks/suite.d.udJtyAgw.js';
|
|
2
2
|
export { VitestRunner, VitestRunnerConfig, createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from './@vitest/runner/index.js';
|
|
3
3
|
export { createChainable } from './@vitest/runner/utils.js';
|
|
4
4
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
package/dist/suite.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { g as getBenchFn, a as getBenchOptions } from './chunks/benchmark.
|
|
1
|
+
export { g as getBenchFn, a as getBenchOptions } from './chunks/benchmark.D0SlKNbZ.js';
|
|
2
2
|
export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from './@vitest/runner/index.js';
|
|
3
3
|
export { createChainable } from './@vitest/runner/utils.js';
|
|
4
4
|
import './@vitest/utils/helpers.js';
|
|
5
|
-
import './chunks/utils.
|
|
5
|
+
import './chunks/utils.BX5Fg8C4.js';
|
|
6
6
|
import './@vitest/utils/timers.js';
|
|
7
|
+
|
|
8
|
+
console.warn("Importing from \"vitest/suite\" is deprecated since Vitest 4.1. Please use static methods of \"TestRunner\" from the \"vitest\" entry point instead: e.g., `TestRunner.getCurrentTest()`.");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "blazediff_core";
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@blazediff+core@1.9.1/node_modules/@blazediff/core/dist/index.mjs
|
|
2
|
+
function g(n, r, t, e, o, { threshold: f = .1, alpha: c = .1, aaColor: s = [
|
|
3
|
+
255,
|
|
4
|
+
255,
|
|
5
|
+
0
|
|
6
|
+
], diffColor: a = [
|
|
7
|
+
255,
|
|
8
|
+
0,
|
|
9
|
+
0
|
|
10
|
+
], includeAA: U, diffColorAlt: O, diffMask: b, fastBufferCheck: y = true } = {}) {
|
|
11
|
+
if (!_(n) || !_(r) || t && !_(t)) throw new Error("Image data: Uint8Array, Uint8ClampedArray or Buffer expected.");
|
|
12
|
+
if (n.length !== r.length || t && t.length !== n.length) throw new Error(`Image sizes do not match. Image 1 size: ${n.length}, image 2 size: ${r.length}`);
|
|
13
|
+
if (n.length !== e * o * 4) throw new Error(`Image data size does not match width/height. Expecting ${e * o * 4}. Got ${n.length}`);
|
|
14
|
+
if (y && typeof Buffer < "u" && Buffer.compare && n instanceof Uint8Array && r instanceof Uint8Array && Buffer.compare(n, r) === 0) {
|
|
15
|
+
if (t && !b) for (let A = 0; A < e * o; A++) L(n, A * 4, c, t);
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
let m = e * o, u = new Uint32Array(n.buffer, n.byteOffset, m), d = new Uint32Array(r.buffer, r.byteOffset, m), l = tn(e, o), i = Math.ceil(e / l), I = Math.ceil(o / l), z = i * I, x = new Uint16Array(z), M = 35215 * f * f, B = 0;
|
|
19
|
+
for (let A = 0; A < I; A++) for (let R = 0; R < i; R++) {
|
|
20
|
+
let p = R * l, v = A * l, D = Math.min(p + l, e), P = Math.min(v + l, o), $ = false;
|
|
21
|
+
n: for (let C = v; C < P; C++) {
|
|
22
|
+
let Y = C * e;
|
|
23
|
+
for (let G = p; G < D; G++) {
|
|
24
|
+
let E = Y + G;
|
|
25
|
+
if (u[E] === d[E]) continue;
|
|
26
|
+
let S = E * 4, X = N(n, r, S, S);
|
|
27
|
+
if (Math.abs(X) > M) {
|
|
28
|
+
$ = true;
|
|
29
|
+
break n;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if ($) x[B++] = A * i + R;
|
|
34
|
+
else if (t && !b) for (let C = v; C < P; C++) {
|
|
35
|
+
let Y = C * e;
|
|
36
|
+
for (let G = p; G < D; G++) L(n, (Y + G) * 4, c, t);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (B === 0) return 0;
|
|
40
|
+
let [F, J, K] = s, [Q, W, Z] = a, [k, w, h] = O || a, T = 0;
|
|
41
|
+
for (let A = 0; A < B; A++) {
|
|
42
|
+
let R = x[A], p = R % i, v = R / i | 0, D = p * l, P = v * l, $ = Math.min(D + l, e), C = Math.min(P + l, o);
|
|
43
|
+
for (let Y = P; Y < C; Y++) {
|
|
44
|
+
let G = Y * e;
|
|
45
|
+
for (let E = D; E < $; E++) {
|
|
46
|
+
let S = G + E, X = S * 4;
|
|
47
|
+
if (u[S] === d[S]) {
|
|
48
|
+
t && !b && L(n, X, c, t);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
let H = N(n, r, X, X);
|
|
52
|
+
Math.abs(H) > M ? !U && (j(n, E, Y, e, o, u, d) || j(r, E, Y, e, o, d, u)) ? t && !b && V(t, X, F, J, K) : (t && (H < 0 ? V(t, X, k, w, h) : V(t, X, Q, W, Z)), T++) : t && !b && L(n, X, c, t);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return T;
|
|
57
|
+
}
|
|
58
|
+
function _(n) {
|
|
59
|
+
return ArrayBuffer.isView(n) && n.BYTES_PER_ELEMENT === 1;
|
|
60
|
+
}
|
|
61
|
+
var nn = Math.LOG2E;
|
|
62
|
+
function tn(n, r) {
|
|
63
|
+
let t = n * r, e = Math.sqrt(t) / 100, o = 16 * Math.sqrt(e), f = Math.log(o) * nn;
|
|
64
|
+
return 1 << Math.round(f);
|
|
65
|
+
}
|
|
66
|
+
function N(n, r, t, e) {
|
|
67
|
+
let o = n[t], f = n[t + 1], c = n[t + 2], s = n[t + 3], a = r[e], U = r[e + 1], O = r[e + 2], b = r[e + 3], y = o - a, m = f - U, u = c - O, d = s - b;
|
|
68
|
+
if (!y && !m && !u && !d) return 0;
|
|
69
|
+
if (s < 255 || b < 255) {
|
|
70
|
+
let x = 48 + 159 * (t % 2), M = 48 + 159 * ((t / 1.618033988749895 | 0) & 1), B = 48 + 159 * ((t / 2.618033988749895 | 0) & 1);
|
|
71
|
+
y = (o * s - a * b - x * d) / 255, m = (f * s - U * b - M * d) / 255, u = (c * s - O * b - B * d) / 255;
|
|
72
|
+
}
|
|
73
|
+
let l = y * .29889531 + m * .58662247 + u * .11448223, i = y * .59597799 - m * .2741761 - u * .32180189, I = y * .21147017 - m * .52261711 + u * .31114694, z = .5053 * l * l + .299 * i * i + .1957 * I * I;
|
|
74
|
+
return l > 0 ? -z : z;
|
|
75
|
+
}
|
|
76
|
+
function rn(n, r, t, e) {
|
|
77
|
+
let o = n[t], f = n[t + 1], c = n[t + 2], s = n[t + 3], a = r[e], U = r[e + 1], O = r[e + 2], b = r[e + 3], y = o - a, m = f - U, u = c - O, d = s - b;
|
|
78
|
+
if (!y && !m && !u && !d) return 0;
|
|
79
|
+
if (s < 255 || b < 255) {
|
|
80
|
+
let i = 48 + 159 * (t % 2), I = 48 + 159 * ((t / 1.618033988749895 | 0) & 1), z = 48 + 159 * ((t / 2.618033988749895 | 0) & 1);
|
|
81
|
+
y = (o * s - a * b - i * d) / 255, m = (f * s - U * b - I * d) / 255, u = (c * s - O * b - z * d) / 255;
|
|
82
|
+
}
|
|
83
|
+
return y * .29889531 + m * .58662247 + u * .11448223;
|
|
84
|
+
}
|
|
85
|
+
function j(n, r, t, e, o, f, c) {
|
|
86
|
+
let s = Math.max(r - 1, 0), a = Math.max(t - 1, 0), U = Math.min(r + 1, e - 1), O = Math.min(t + 1, o - 1), y = (t * e + r) * 4, m = r === s || r === U || t === a || t === O ? 1 : 0, u = 0, d = 0, l = 0, i = 0, I = 0, z = 0;
|
|
87
|
+
for (let x = s; x <= U; x++) for (let M = a; M <= O; M++) {
|
|
88
|
+
if (x === r && M === t) continue;
|
|
89
|
+
let B = rn(n, n, y, (M * e + x) * 4);
|
|
90
|
+
if (B === 0) {
|
|
91
|
+
if (m++, m > 2) return false;
|
|
92
|
+
} else B < u ? (u = B, l = x, i = M) : B > d && (d = B, I = x, z = M);
|
|
93
|
+
}
|
|
94
|
+
return u === 0 || d === 0 ? false : q(f, l, i, e, o) && q(c, l, i, e, o) || q(f, I, z, e, o) && q(c, I, z, e, o);
|
|
95
|
+
}
|
|
96
|
+
function q(n, r, t, e, o) {
|
|
97
|
+
let f = t * e + r, c = n[f], s = r === 0 || r === e - 1 || t === 0 || t === o - 1 ? 1 : 0;
|
|
98
|
+
if (t > 0) {
|
|
99
|
+
let a = f - e;
|
|
100
|
+
r > 0 && n[a - 1] === c && s++, n[a] === c && s++, r < e - 1 && n[a + 1] === c && s++;
|
|
101
|
+
}
|
|
102
|
+
if (r > 0 && n[f - 1] === c && s++, r < e - 1 && n[f + 1] === c && s++, t < o - 1) {
|
|
103
|
+
let a = f + e;
|
|
104
|
+
r > 0 && n[a - 1] === c && s++, n[a] === c && s++, r < e - 1 && n[a + 1] === c && s++;
|
|
105
|
+
}
|
|
106
|
+
return s > 2;
|
|
107
|
+
}
|
|
108
|
+
function L(n, r, t, e) {
|
|
109
|
+
let o = 255 + (n[r] * .29889531 + n[r + 1] * .58662247 + n[r + 2] * .11448223 - 255) * t * n[r + 3] / 255;
|
|
110
|
+
V(e, r, o, o, o);
|
|
111
|
+
}
|
|
112
|
+
function V(n, r, t, e, o) {
|
|
113
|
+
n[r + 0] = t, n[r + 1] = e, n[r + 2] = o, n[r + 3] = 255;
|
|
114
|
+
}
|
|
115
|
+
var on = g;
|
|
116
|
+
//#endregion
|
|
117
|
+
export { j as antialiased, rn as brightnessDelta, tn as calculateOptimalBlockSize, N as colorDelta, on as default, g as diff, L as drawGrayPixel, V as drawPixel, _ as isValidImage };
|