@voidzero-dev/vite-plus-test 0.0.0-0bfcc90f.20260209-0731
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 +691 -0
- package/browser/context.d.ts +4 -0
- package/browser/context.js +20 -0
- package/config.d.ts +3 -0
- package/coverage.d.ts +1 -0
- package/dist/@vitest/browser/client/.vite/manifest.json +24 -0
- package/dist/@vitest/browser/client/__vitest__/assets/index-BUCFJtth.js +57 -0
- package/dist/@vitest/browser/client/__vitest__/assets/index-DlhE0rqZ.css +1 -0
- package/dist/@vitest/browser/client/__vitest__/bg.png +0 -0
- package/dist/@vitest/browser/client/__vitest__/favicon.ico +0 -0
- package/dist/@vitest/browser/client/__vitest__/favicon.svg +5 -0
- package/dist/@vitest/browser/client/__vitest__/index.html +32 -0
- package/dist/@vitest/browser/client/__vitest_browser__/orchestrator-S_3e_uzt.js +345 -0
- package/dist/@vitest/browser/client/__vitest_browser__/tester-k74mgIRa.js +2171 -0
- package/dist/@vitest/browser/client/__vitest_browser__/utils-uxqdqUz8.js +223 -0
- package/dist/@vitest/browser/client/error-catcher.js +82 -0
- package/dist/@vitest/browser/client/esm-client-injector.js +67 -0
- package/dist/@vitest/browser/client/favicon.svg +5 -0
- package/dist/@vitest/browser/client/orchestrator.html +35 -0
- package/dist/@vitest/browser/client/tester/tester.html +13 -0
- package/dist/@vitest/browser/client.js +456 -0
- package/dist/@vitest/browser/context.d.ts +792 -0
- package/dist/@vitest/browser/context.js +541 -0
- package/dist/@vitest/browser/expect-element.js +32 -0
- package/dist/@vitest/browser/index-D6m36C6U.js +11 -0
- package/dist/@vitest/browser/index.d.ts +73 -0
- package/dist/@vitest/browser/index.js +3513 -0
- package/dist/@vitest/browser/jest-dom.d.ts +724 -0
- package/dist/@vitest/browser/locators.d.ts +354 -0
- package/dist/@vitest/browser/locators.js +1 -0
- package/dist/@vitest/browser/matchers.d.ts +29 -0
- package/dist/@vitest/browser/shared/screenshotMatcher/types.d.ts +22 -0
- package/dist/@vitest/browser/state.js +280 -0
- package/dist/@vitest/browser/types.d.ts +69 -0
- package/dist/@vitest/browser-playwright/context.d.ts +1 -0
- package/dist/@vitest/browser-playwright/index.d.ts +106 -0
- package/dist/@vitest/browser-playwright/index.js +1111 -0
- package/dist/@vitest/browser-playwright/locators.js +114 -0
- package/dist/@vitest/browser-preview/context.d.ts +1 -0
- package/dist/@vitest/browser-preview/index.d.ts +19 -0
- package/dist/@vitest/browser-preview/index.js +148 -0
- package/dist/@vitest/browser-preview/locators.js +79 -0
- package/dist/@vitest/browser-webdriverio/context.d.ts +1 -0
- package/dist/@vitest/browser-webdriverio/index.d.ts +63 -0
- package/dist/@vitest/browser-webdriverio/index.js +600 -0
- package/dist/@vitest/browser-webdriverio/locators.js +163 -0
- package/dist/@vitest/expect/index.d.ts +807 -0
- package/dist/@vitest/expect/index.js +1875 -0
- package/dist/@vitest/mocker/auto-register.d.ts +2 -0
- package/dist/@vitest/mocker/auto-register.js +9 -0
- package/dist/@vitest/mocker/automock.d.ts +12 -0
- package/dist/@vitest/mocker/automock.js +1 -0
- package/dist/@vitest/mocker/browser.d.ts +53 -0
- package/dist/@vitest/mocker/browser.js +91 -0
- package/dist/@vitest/mocker/chunk-automock.js +354 -0
- package/dist/@vitest/mocker/chunk-interceptor-native.js +15 -0
- package/dist/@vitest/mocker/chunk-mocker.js +521 -0
- package/dist/@vitest/mocker/chunk-pathe.M-eThtNZ.js +174 -0
- package/dist/@vitest/mocker/chunk-registry.js +185 -0
- package/dist/@vitest/mocker/chunk-utils.js +16 -0
- package/dist/@vitest/mocker/index.d-C-sLYZi-.d.ts +25 -0
- package/dist/@vitest/mocker/index.d.ts +2 -0
- package/dist/@vitest/mocker/index.js +185 -0
- package/dist/@vitest/mocker/mocker.d-TnKRhz7N.d.ts +81 -0
- package/dist/@vitest/mocker/node.d.ts +800 -0
- package/dist/@vitest/mocker/node.js +966 -0
- package/dist/@vitest/mocker/redirect.d.ts +3 -0
- package/dist/@vitest/mocker/redirect.js +79 -0
- package/dist/@vitest/mocker/register.d.ts +9 -0
- package/dist/@vitest/mocker/register.js +41 -0
- package/dist/@vitest/mocker/types.d-B8CCKmHt.d.ts +107 -0
- package/dist/@vitest/pretty-format/index.d.ts +124 -0
- package/dist/@vitest/pretty-format/index.js +1022 -0
- package/dist/@vitest/runner/chunk-tasks.js +340 -0
- package/dist/@vitest/runner/index.d.ts +180 -0
- package/dist/@vitest/runner/index.js +2114 -0
- package/dist/@vitest/runner/tasks.d-C7UxawJ9.d.ts +834 -0
- package/dist/@vitest/runner/types.d.ts +183 -0
- package/dist/@vitest/runner/types.js +1 -0
- package/dist/@vitest/runner/utils.d.ts +45 -0
- package/dist/@vitest/runner/utils.js +5 -0
- package/dist/@vitest/snapshot/environment.d-DHdQ1Csl.d.ts +22 -0
- package/dist/@vitest/snapshot/environment.d.ts +16 -0
- package/dist/@vitest/snapshot/environment.js +40 -0
- package/dist/@vitest/snapshot/index.d.ts +130 -0
- package/dist/@vitest/snapshot/index.js +1437 -0
- package/dist/@vitest/snapshot/manager.d.ts +18 -0
- package/dist/@vitest/snapshot/manager.js +73 -0
- package/dist/@vitest/snapshot/rawSnapshot.d-lFsMJFUd.d.ts +61 -0
- package/dist/@vitest/spy/index.d.ts +384 -0
- package/dist/@vitest/spy/index.js +433 -0
- package/dist/@vitest/utils/chunk-_commonjsHelpers.js +5 -0
- package/dist/@vitest/utils/chunk-pathe.M-eThtNZ.js +156 -0
- package/dist/@vitest/utils/constants.d.ts +21 -0
- package/dist/@vitest/utils/constants.js +49 -0
- package/dist/@vitest/utils/diff.d.ts +93 -0
- package/dist/@vitest/utils/diff.js +2199 -0
- package/dist/@vitest/utils/display.d.ts +29 -0
- package/dist/@vitest/utils/display.js +742 -0
- package/dist/@vitest/utils/error.d.ts +7 -0
- package/dist/@vitest/utils/error.js +42 -0
- package/dist/@vitest/utils/helpers.d.ts +73 -0
- package/dist/@vitest/utils/helpers.js +295 -0
- package/dist/@vitest/utils/highlight.d.ts +9 -0
- package/dist/@vitest/utils/highlight.js +538 -0
- package/dist/@vitest/utils/index.d.ts +5 -0
- package/dist/@vitest/utils/index.js +1 -0
- package/dist/@vitest/utils/offset.d.ts +5 -0
- package/dist/@vitest/utils/offset.js +32 -0
- package/dist/@vitest/utils/resolver.d.ts +7 -0
- package/dist/@vitest/utils/resolver.js +71 -0
- package/dist/@vitest/utils/serialize.d.ts +3 -0
- package/dist/@vitest/utils/serialize.js +118 -0
- package/dist/@vitest/utils/source-map.d.ts +55 -0
- package/dist/@vitest/utils/source-map.js +478 -0
- package/dist/@vitest/utils/timers.d.ts +33 -0
- package/dist/@vitest/utils/timers.js +49 -0
- package/dist/@vitest/utils/types.d-BCElaP-c.d.ts +53 -0
- package/dist/@vitest/utils/types.d.ts +34 -0
- package/dist/@vitest/utils/types.js +1 -0
- package/dist/browser-compat.js +3 -0
- package/dist/browser.d.ts +46 -0
- package/dist/browser.js +20 -0
- package/dist/chunks/_commonjsHelpers.D26ty3Ew.js +6 -0
- package/dist/chunks/base.CJ0Y4ePK.js +165 -0
- package/dist/chunks/benchmark.B3N2zMcH.js +40 -0
- package/dist/chunks/benchmark.d.DAaHLpsq.d.ts +24 -0
- package/dist/chunks/browser.d.ChKACdzH.d.ts +59 -0
- package/dist/chunks/cac.DVeoLl0M.js +1409 -0
- package/dist/chunks/cli-api.B7PN_QUv.js +13672 -0
- package/dist/chunks/config.d.Cy95HiCx.d.ts +210 -0
- package/dist/chunks/console.Cf-YriPC.js +146 -0
- package/dist/chunks/constants.D_Q9UYh-.js +36 -0
- package/dist/chunks/coverage.AVPTjMgw.js +3292 -0
- package/dist/chunks/coverage.D_JHT54q.js +25 -0
- package/dist/chunks/coverage.d.BZtK59WP.d.ts +37 -0
- package/dist/chunks/creator.DAmOKTvJ.js +673 -0
- package/dist/chunks/date.Bq6ZW5rf.js +73 -0
- package/dist/chunks/defaults.BOqNVLsY.js +74 -0
- package/dist/chunks/env.D4Lgay0q.js +8 -0
- package/dist/chunks/environment.d.CrsxCzP1.d.ts +29 -0
- package/dist/chunks/evaluatedModules.Dg1zASAC.js +17 -0
- package/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts +7 -0
- package/dist/chunks/git.Bm2pzPAa.js +71 -0
- package/dist/chunks/global.d.B15mdLcR.d.ts +99 -0
- package/dist/chunks/globals.DOayXfHP.js +30 -0
- package/dist/chunks/index.6Qv1eEA6.js +109 -0
- package/dist/chunks/index.C5r1PdPD.js +231 -0
- package/dist/chunks/index.Chj8NDwU.js +206 -0
- package/dist/chunks/index.CyBMJtT7.js +727 -0
- package/dist/chunks/index.D3XRDfWc.js +213 -0
- package/dist/chunks/index.D4KonVSU.js +6343 -0
- package/dist/chunks/index.M8mOzt4Y.js +3839 -0
- package/dist/chunks/index.Z5E_ObnR.js +37 -0
- package/dist/chunks/init-forks._y3TW739.js +41 -0
- package/dist/chunks/init-threads.DBO2kn-p.js +18 -0
- package/dist/chunks/init.B6MLFIaN.js +334 -0
- package/dist/chunks/inspector.CvyFGlXm.js +53 -0
- package/dist/chunks/modules.BJuCwlRJ.js +36 -0
- package/dist/chunks/node.Ce0vMQM7.js +14 -0
- package/dist/chunks/plugin.d.CtqpEehP.d.ts +38 -0
- package/dist/chunks/reporters.d.CWXNI2jG.d.ts +3271 -0
- package/dist/chunks/rpc.BoxB0q7B.js +76 -0
- package/dist/chunks/rpc.d.RH3apGEf.d.ts +64 -0
- package/dist/chunks/setup-common.Cm-kSBVi.js +60 -0
- package/dist/chunks/startModuleRunner.DEj0jb3e.js +861 -0
- package/dist/chunks/suite.d.BJWk38HB.d.ts +10 -0
- package/dist/chunks/test.B8ej_ZHS.js +254 -0
- package/dist/chunks/traces.CCmnQaNT.js +217 -0
- package/dist/chunks/traces.d.402V_yFI.d.ts +18 -0
- package/dist/chunks/utils.DvEY5TfP.js +52 -0
- package/dist/chunks/vi.2VT5v0um.js +3919 -0
- package/dist/chunks/vm.D3epNOPZ.js +744 -0
- package/dist/chunks/worker.d.Dyxm8DEL.d.ts +255 -0
- package/dist/cli.js +28 -0
- package/dist/client/.vite/manifest.json +24 -0
- package/dist/client/__vitest__/assets/index-BUCFJtth.js +57 -0
- package/dist/client/__vitest__/assets/index-DlhE0rqZ.css +1 -0
- package/dist/client/__vitest__/bg.png +0 -0
- package/dist/client/__vitest__/favicon.ico +0 -0
- package/dist/client/__vitest__/favicon.svg +5 -0
- package/dist/client/__vitest__/index.html +32 -0
- package/dist/client/__vitest_browser__/orchestrator-S_3e_uzt.js +345 -0
- package/dist/client/__vitest_browser__/tester-k74mgIRa.js +2171 -0
- package/dist/client/__vitest_browser__/utils-uxqdqUz8.js +223 -0
- package/dist/client/error-catcher.js +82 -0
- package/dist/client/esm-client-injector.js +67 -0
- package/dist/client/favicon.svg +5 -0
- package/dist/client/orchestrator.html +35 -0
- package/dist/client/tester/tester.html +13 -0
- package/dist/client.js +456 -0
- package/dist/config.cjs +94 -0
- package/dist/config.d.ts +104 -0
- package/dist/config.js +15 -0
- package/dist/context.js +541 -0
- package/dist/coverage.d.ts +118 -0
- package/dist/coverage.js +23 -0
- package/dist/dummy.js +2 -0
- package/dist/environments.d.ts +22 -0
- package/dist/environments.js +3 -0
- package/dist/expect-element.js +27 -0
- package/dist/index-D6m36C6U.js +6 -0
- package/dist/index-node.js +7 -0
- package/dist/index.d.ts +510 -0
- package/dist/index.js +19 -0
- package/dist/locators.d.ts +354 -0
- package/dist/locators.js +1 -0
- package/dist/mocker.d.ts +1 -0
- package/dist/mocker.js +1 -0
- package/dist/module-evaluator.d.ts +124 -0
- package/dist/module-evaluator.js +343 -0
- package/dist/module-runner-stub.js +44 -0
- package/dist/module-runner.js +17 -0
- package/dist/node.d.ts +251 -0
- package/dist/node.js +98 -0
- package/dist/path.js +7 -0
- package/dist/plugins/browser-client.mjs +2 -0
- package/dist/plugins/browser-context.mjs +2 -0
- package/dist/plugins/browser-locators.mjs +2 -0
- package/dist/plugins/browser-playwright.mjs +2 -0
- package/dist/plugins/browser-preview.mjs +2 -0
- package/dist/plugins/browser-webdriverio.mjs +2 -0
- package/dist/plugins/browser.mjs +2 -0
- package/dist/plugins/expect.mjs +2 -0
- package/dist/plugins/mocker-automock.mjs +2 -0
- package/dist/plugins/mocker-browser.mjs +2 -0
- package/dist/plugins/mocker-node.mjs +2 -0
- package/dist/plugins/mocker-redirect.mjs +2 -0
- package/dist/plugins/mocker-register.mjs +2 -0
- package/dist/plugins/mocker.mjs +2 -0
- package/dist/plugins/pretty-format.mjs +2 -0
- package/dist/plugins/runner-types.mjs +2 -0
- package/dist/plugins/runner-utils.mjs +2 -0
- package/dist/plugins/runner.mjs +2 -0
- package/dist/plugins/snapshot-environment.mjs +2 -0
- package/dist/plugins/snapshot-manager.mjs +2 -0
- package/dist/plugins/snapshot.mjs +2 -0
- package/dist/plugins/spy.mjs +2 -0
- package/dist/plugins/utils-constants.mjs +2 -0
- package/dist/plugins/utils-diff.mjs +2 -0
- package/dist/plugins/utils-display.mjs +2 -0
- package/dist/plugins/utils-error.mjs +2 -0
- package/dist/plugins/utils-helpers.mjs +2 -0
- package/dist/plugins/utils-highlight.mjs +2 -0
- package/dist/plugins/utils-offset.mjs +2 -0
- package/dist/plugins/utils-resolver.mjs +2 -0
- package/dist/plugins/utils-serialize.mjs +2 -0
- package/dist/plugins/utils-source-map.mjs +2 -0
- package/dist/plugins/utils-timers.mjs +2 -0
- package/dist/plugins/utils.mjs +2 -0
- package/dist/reporters.d.ts +27 -0
- package/dist/reporters.js +24 -0
- package/dist/runners.d.ts +50 -0
- package/dist/runners.js +19 -0
- package/dist/shared/screenshotMatcher/types.d.ts +22 -0
- package/dist/snapshot.d.ts +9 -0
- package/dist/snapshot.js +4 -0
- package/dist/spy.js +1 -0
- package/dist/state.js +280 -0
- package/dist/suite.d.ts +5 -0
- package/dist/suite.js +6 -0
- package/dist/types.d.ts +69 -0
- package/dist/vendor/chai.d.mts +1 -0
- package/dist/vendor/chai.mjs +3577 -0
- package/dist/vendor/es-module-lexer.d.mts +193 -0
- package/dist/vendor/es-module-lexer.mjs +79 -0
- package/dist/vendor/estree-walker.d.mts +583 -0
- package/dist/vendor/estree-walker.mjs +339 -0
- package/dist/vendor/expect-type.d.mts +1574 -0
- package/dist/vendor/expect-type.mjs +214 -0
- package/dist/vendor/magic-string.d.mts +261 -0
- package/dist/vendor/magic-string.mjs +1700 -0
- package/dist/vendor/obug.d.mts +56 -0
- package/dist/vendor/obug.mjs +276 -0
- package/dist/vendor/pathe.d.mts +46 -0
- package/dist/vendor/pathe.mjs +496 -0
- package/dist/vendor/picomatch.d.mts +1 -0
- package/dist/vendor/picomatch.mjs +1855 -0
- package/dist/vendor/shared-3g9mwCWP.mjs +31 -0
- package/dist/vendor/std-env.d.mts +88 -0
- package/dist/vendor/std-env.mjs +159 -0
- package/dist/vendor/tinybench.d.mts +317 -0
- package/dist/vendor/tinybench.mjs +504 -0
- package/dist/vendor/tinyexec.d.mts +72 -0
- package/dist/vendor/tinyexec.mjs +637 -0
- package/dist/vendor/tinyglobby.d.mts +157 -0
- package/dist/vendor/tinyglobby.mjs +832 -0
- package/dist/vendor/tinyrainbow.d.mts +60 -0
- package/dist/vendor/tinyrainbow.mjs +93 -0
- package/dist/vendor/vitest_browser.mjs +2 -0
- package/dist/vendor/vitest_internal_browser.mjs +2 -0
- package/dist/vendor/vitest_runner.mjs +2 -0
- package/dist/vendor/vitest_runners.mjs +2 -0
- package/dist/worker.d.ts +32 -0
- package/dist/worker.js +48 -0
- package/dist/workers/forks.js +54 -0
- package/dist/workers/runVmTests.js +95 -0
- package/dist/workers/threads.js +55 -0
- package/dist/workers/vmForks.js +36 -0
- package/dist/workers/vmThreads.js +37 -0
- package/environments.d.ts +1 -0
- package/globals.d.ts +20 -0
- package/import-meta.d.ts +5 -0
- package/importMeta.d.ts +4 -0
- package/index.cjs +5 -0
- package/index.d.cts +1 -0
- package/jsdom.d.ts +6 -0
- package/mocker.d.ts +1 -0
- package/node.d.ts +1 -0
- package/optional-types.d.ts +7 -0
- package/package.json +335 -0
- package/reporters.d.ts +1 -0
- package/runners.d.ts +1 -0
- package/snapshot.d.ts +1 -0
- package/suite.d.ts +1 -0
- package/suppress-warnings.cjs +21 -0
- package/vitest.mjs +2 -0
- package/worker.d.ts +1 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const SAFE_TIMERS_SYMBOL = Symbol("vitest:SAFE_TIMERS");
|
|
2
|
+
function getSafeTimers() {
|
|
3
|
+
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
|
|
4
|
+
const { nextTick: safeNextTick } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis.process || {};
|
|
5
|
+
return {
|
|
6
|
+
nextTick: safeNextTick,
|
|
7
|
+
setTimeout: safeSetTimeout,
|
|
8
|
+
setInterval: safeSetInterval,
|
|
9
|
+
clearInterval: safeClearInterval,
|
|
10
|
+
clearTimeout: safeClearTimeout,
|
|
11
|
+
setImmediate: safeSetImmediate,
|
|
12
|
+
clearImmediate: safeClearImmediate,
|
|
13
|
+
queueMicrotask: safeQueueMicrotask
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function setSafeTimers() {
|
|
17
|
+
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis;
|
|
18
|
+
const { nextTick: safeNextTick } = globalThis.process || {};
|
|
19
|
+
const timers = {
|
|
20
|
+
nextTick: safeNextTick,
|
|
21
|
+
setTimeout: safeSetTimeout,
|
|
22
|
+
setInterval: safeSetInterval,
|
|
23
|
+
clearInterval: safeClearInterval,
|
|
24
|
+
clearTimeout: safeClearTimeout,
|
|
25
|
+
setImmediate: safeSetImmediate,
|
|
26
|
+
clearImmediate: safeClearImmediate,
|
|
27
|
+
queueMicrotask: safeQueueMicrotask
|
|
28
|
+
};
|
|
29
|
+
globalThis[SAFE_TIMERS_SYMBOL] = timers;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns a promise that resolves after the specified duration.
|
|
33
|
+
*
|
|
34
|
+
* @param timeout - Delay in milliseconds
|
|
35
|
+
* @param scheduler - Timer function to use, defaults to `setTimeout`. Useful for mocked timers.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* await delay(100)
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // With mocked timers
|
|
42
|
+
* const { setTimeout } = getSafeTimers()
|
|
43
|
+
* await delay(100, setTimeout)
|
|
44
|
+
*/
|
|
45
|
+
function delay(timeout, scheduler = setTimeout) {
|
|
46
|
+
return new Promise((resolve) => scheduler(resolve, timeout));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { delay, getSafeTimers, setSafeTimers };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CompareKeys } from '../pretty-format/index.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
type DiffOptionsColor = (arg: string) => string;
|
|
11
|
+
interface DiffOptions {
|
|
12
|
+
aAnnotation?: string;
|
|
13
|
+
aColor?: DiffOptionsColor;
|
|
14
|
+
aIndicator?: string;
|
|
15
|
+
bAnnotation?: string;
|
|
16
|
+
bColor?: DiffOptionsColor;
|
|
17
|
+
bIndicator?: string;
|
|
18
|
+
changeColor?: DiffOptionsColor;
|
|
19
|
+
changeLineTrailingSpaceColor?: DiffOptionsColor;
|
|
20
|
+
commonColor?: DiffOptionsColor;
|
|
21
|
+
commonIndicator?: string;
|
|
22
|
+
commonLineTrailingSpaceColor?: DiffOptionsColor;
|
|
23
|
+
contextLines?: number;
|
|
24
|
+
emptyFirstOrLastLinePlaceholder?: string;
|
|
25
|
+
expand?: boolean;
|
|
26
|
+
includeChangeCounts?: boolean;
|
|
27
|
+
omitAnnotationLines?: boolean;
|
|
28
|
+
patchColor?: DiffOptionsColor;
|
|
29
|
+
printBasicPrototype?: boolean;
|
|
30
|
+
maxDepth?: number;
|
|
31
|
+
compareKeys?: CompareKeys;
|
|
32
|
+
truncateThreshold?: number;
|
|
33
|
+
truncateAnnotation?: string;
|
|
34
|
+
truncateAnnotationColor?: DiffOptionsColor;
|
|
35
|
+
}
|
|
36
|
+
interface SerializedDiffOptions {
|
|
37
|
+
aAnnotation?: string;
|
|
38
|
+
aIndicator?: string;
|
|
39
|
+
bAnnotation?: string;
|
|
40
|
+
bIndicator?: string;
|
|
41
|
+
commonIndicator?: string;
|
|
42
|
+
contextLines?: number;
|
|
43
|
+
emptyFirstOrLastLinePlaceholder?: string;
|
|
44
|
+
expand?: boolean;
|
|
45
|
+
includeChangeCounts?: boolean;
|
|
46
|
+
omitAnnotationLines?: boolean;
|
|
47
|
+
printBasicPrototype?: boolean;
|
|
48
|
+
maxDepth?: number;
|
|
49
|
+
truncateThreshold?: number;
|
|
50
|
+
truncateAnnotation?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type { DiffOptions as D, SerializedDiffOptions as S, DiffOptionsColor as a };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type Awaitable<T> = T | PromiseLike<T>;
|
|
2
|
+
type Nullable<T> = T | null | undefined;
|
|
3
|
+
type Arrayable<T> = T | Array<T>;
|
|
4
|
+
type ArgumentsType<T> = T extends (...args: infer U) => any ? U : never;
|
|
5
|
+
type MergeInsertions<T> = T extends object ? { [K in keyof T] : MergeInsertions<T[K]> } : T;
|
|
6
|
+
type DeepMerge<
|
|
7
|
+
F,
|
|
8
|
+
S
|
|
9
|
+
> = MergeInsertions<{ [K in keyof F | keyof S] : K extends keyof S & keyof F ? DeepMerge<F[K], S[K]> : K extends keyof S ? S[K] : K extends keyof F ? F[K] : never }>;
|
|
10
|
+
interface Constructable {
|
|
11
|
+
new (...args: any[]): any;
|
|
12
|
+
}
|
|
13
|
+
interface ParsedStack {
|
|
14
|
+
method: string;
|
|
15
|
+
file: string;
|
|
16
|
+
line: number;
|
|
17
|
+
column: number;
|
|
18
|
+
}
|
|
19
|
+
interface SerializedError {
|
|
20
|
+
message: string;
|
|
21
|
+
stacks?: ParsedStack[];
|
|
22
|
+
stack?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
cause?: SerializedError;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
interface TestError extends SerializedError {
|
|
28
|
+
cause?: TestError;
|
|
29
|
+
diff?: string;
|
|
30
|
+
actual?: string;
|
|
31
|
+
expected?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type { ArgumentsType, Arrayable, Awaitable, Constructable, DeepMerge, MergeInsertions, Nullable, ParsedStack, SerializedError, TestError };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.d.Cy95HiCx.js';
|
|
2
|
+
import { R as RuntimeCoverageModuleLoader } from './chunks/coverage.d.BZtK59WP.js';
|
|
3
|
+
import { SerializedDiffOptions } from './@vitest/utils/diff.js';
|
|
4
|
+
export { O as OTELCarrier, T as Traces } from './chunks/traces.d.402V_yFI.js';
|
|
5
|
+
export { collectTests, startTests } from './@vitest/runner/index.js';
|
|
6
|
+
import * as _vitest_spy from './@vitest/spy/index.js';
|
|
7
|
+
export { _vitest_spy as SpyModule };
|
|
8
|
+
export { LoupeOptions, ParsedStack, StringifyOptions } from './@vitest/utils/index.js';
|
|
9
|
+
export { browserFormat, format, inspect, stringify } from './@vitest/utils/display.js';
|
|
10
|
+
export { processError } from './@vitest/utils/error.js';
|
|
11
|
+
export { getType } from './@vitest/utils/helpers.js';
|
|
12
|
+
export { DecodedMap, getOriginalPosition } from './@vitest/utils/source-map.js';
|
|
13
|
+
export { getSafeTimers, setSafeTimers } from './@vitest/utils/timers.js';
|
|
14
|
+
import './@vitest/pretty-format/index.js';
|
|
15
|
+
import './@vitest/snapshot/index.js';
|
|
16
|
+
|
|
17
|
+
declare function startCoverageInsideWorker(options: SerializedCoverageConfig | undefined, loader: RuntimeCoverageModuleLoader, runtimeOptions: {
|
|
18
|
+
isolate: boolean;
|
|
19
|
+
}): Promise<unknown>;
|
|
20
|
+
declare function takeCoverageInsideWorker(options: SerializedCoverageConfig | undefined, loader: RuntimeCoverageModuleLoader): Promise<unknown>;
|
|
21
|
+
declare function stopCoverageInsideWorker(options: SerializedCoverageConfig | undefined, loader: RuntimeCoverageModuleLoader, runtimeOptions: {
|
|
22
|
+
isolate: boolean;
|
|
23
|
+
}): Promise<unknown>;
|
|
24
|
+
|
|
25
|
+
interface PublicModuleRunner {
|
|
26
|
+
import: (id: string) => Promise<any>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare function setupCommonEnv(config: SerializedConfig): Promise<void>;
|
|
30
|
+
declare function loadDiffConfig(config: SerializedConfig, moduleRunner: PublicModuleRunner): Promise<SerializedDiffOptions | undefined>;
|
|
31
|
+
declare function loadSnapshotSerializers(config: SerializedConfig, moduleRunner: PublicModuleRunner): Promise<void>;
|
|
32
|
+
|
|
33
|
+
interface FsOptions {
|
|
34
|
+
encoding?: BufferEncoding;
|
|
35
|
+
flag?: string | number;
|
|
36
|
+
}
|
|
37
|
+
interface BrowserCommands {
|
|
38
|
+
readFile: (path: string, options?: BufferEncoding | FsOptions) => Promise<string>;
|
|
39
|
+
writeFile: (path: string, content: string, options?: BufferEncoding | (FsOptions & {
|
|
40
|
+
mode?: number | string;
|
|
41
|
+
})) => Promise<void>;
|
|
42
|
+
removeFile: (path: string) => Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { loadDiffConfig, loadSnapshotSerializers, setupCommonEnv, startCoverageInsideWorker, stopCoverageInsideWorker, takeCoverageInsideWorker };
|
|
46
|
+
export type { BrowserCommands, FsOptions };
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.Cm-kSBVi.js';
|
|
2
|
+
export { T as Traces } from './chunks/traces.CCmnQaNT.js';
|
|
3
|
+
export { collectTests, startTests } from './@vitest/runner/index.js';
|
|
4
|
+
import * as spyModule from './@vitest/spy/index.js';
|
|
5
|
+
export { spyModule as SpyModule };
|
|
6
|
+
export { browserFormat, format, inspect, stringify } from './@vitest/utils/display.js';
|
|
7
|
+
export { processError } from './@vitest/utils/error.js';
|
|
8
|
+
export { getType } from './@vitest/utils/helpers.js';
|
|
9
|
+
export { DecodedMap, getOriginalPosition } from './@vitest/utils/source-map.js';
|
|
10
|
+
export { getSafeTimers, setSafeTimers } from './@vitest/utils/timers.js';
|
|
11
|
+
import './chunks/coverage.D_JHT54q.js';
|
|
12
|
+
import './@vitest/snapshot/index.js';
|
|
13
|
+
import './chunks/utils.DvEY5TfP.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
const __INTERNAL = { _extendedMethods: /* @__PURE__ */ new Set() };
|
|
19
|
+
|
|
20
|
+
export { __INTERNAL };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2
|
+
function getDefaultExportFromCjs(x) {
|
|
3
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export { commonjsGlobal as c, getDefaultExportFromCjs as g };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { runInThisContext } from 'node:vm';
|
|
2
|
+
import * as spyModule from '../@vitest/spy/index.js';
|
|
3
|
+
import { r as resolveTestRunner, a as resolveSnapshotEnvironment, s as setupChaiConfig } from './index.6Qv1eEA6.js';
|
|
4
|
+
import { l as loadEnvironment, e as emitModuleRunner } from './init.B6MLFIaN.js';
|
|
5
|
+
import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
|
|
6
|
+
import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startModuleRunner.DEj0jb3e.js';
|
|
7
|
+
import { performance as performance$1 } from 'node:perf_hooks';
|
|
8
|
+
import { startTests, collectTests } from '../@vitest/runner/index.js';
|
|
9
|
+
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './setup-common.Cm-kSBVi.js';
|
|
10
|
+
import { g as globalExpect, v as vi } from './vi.2VT5v0um.js';
|
|
11
|
+
import { c as closeInspector } from './inspector.CvyFGlXm.js';
|
|
12
|
+
import { createRequire } from 'node:module';
|
|
13
|
+
import timers from 'node:timers';
|
|
14
|
+
import timersPromises from 'node:timers/promises';
|
|
15
|
+
import util from 'node:util';
|
|
16
|
+
import { KNOWN_ASSET_TYPES } from '../@vitest/utils/constants.js';
|
|
17
|
+
import { i as index } from './index.Z5E_ObnR.js';
|
|
18
|
+
import { g as getWorkerState, r as resetModules, p as provideWorkerState } from './utils.DvEY5TfP.js';
|
|
19
|
+
|
|
20
|
+
// this should only be used in Node
|
|
21
|
+
let globalSetup = false;
|
|
22
|
+
async function setupGlobalEnv(config, environment) {
|
|
23
|
+
await setupCommonEnv(config);
|
|
24
|
+
Object.defineProperty(globalThis, "__vitest_index__", {
|
|
25
|
+
value: index,
|
|
26
|
+
enumerable: false
|
|
27
|
+
});
|
|
28
|
+
globalExpect.setState({ environment: environment.name });
|
|
29
|
+
if (globalSetup) return;
|
|
30
|
+
globalSetup = true;
|
|
31
|
+
if ((environment.viteEnvironment || environment.name) === "client") {
|
|
32
|
+
const _require = createRequire(import.meta.url);
|
|
33
|
+
// always mock "required" `css` files, because we cannot process them
|
|
34
|
+
_require.extensions[".css"] = resolveCss;
|
|
35
|
+
_require.extensions[".scss"] = resolveCss;
|
|
36
|
+
_require.extensions[".sass"] = resolveCss;
|
|
37
|
+
_require.extensions[".less"] = resolveCss;
|
|
38
|
+
// since we are using Vite, we can assume how these will be resolved
|
|
39
|
+
KNOWN_ASSET_TYPES.forEach((type) => {
|
|
40
|
+
_require.extensions[`.${type}`] = resolveAsset;
|
|
41
|
+
});
|
|
42
|
+
process.env.SSR = "";
|
|
43
|
+
} else process.env.SSR = "1";
|
|
44
|
+
// @ts-expect-error not typed global for patched timers
|
|
45
|
+
globalThis.__vitest_required__ = {
|
|
46
|
+
util,
|
|
47
|
+
timers,
|
|
48
|
+
timersPromises
|
|
49
|
+
};
|
|
50
|
+
if (!config.disableConsoleIntercept) await setupConsoleLogSpy();
|
|
51
|
+
}
|
|
52
|
+
function resolveCss(mod) {
|
|
53
|
+
mod.exports = "";
|
|
54
|
+
}
|
|
55
|
+
function resolveAsset(mod, url) {
|
|
56
|
+
mod.exports = url;
|
|
57
|
+
}
|
|
58
|
+
async function setupConsoleLogSpy() {
|
|
59
|
+
const { createCustomConsole } = await import('./console.Cf-YriPC.js');
|
|
60
|
+
globalThis.console = createCustomConsole();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// browser shouldn't call this!
|
|
64
|
+
async function run(method, files, config, moduleRunner, environment, traces) {
|
|
65
|
+
const workerState = getWorkerState();
|
|
66
|
+
const [testRunner] = await Promise.all([
|
|
67
|
+
traces.$("vitest.runtime.runner", () => resolveTestRunner(config, moduleRunner, traces)),
|
|
68
|
+
traces.$("vitest.runtime.global_env", () => setupGlobalEnv(config, environment)),
|
|
69
|
+
traces.$("vitest.runtime.coverage.start", () => startCoverageInsideWorker(config.coverage, moduleRunner, { isolate: config.isolate })),
|
|
70
|
+
traces.$("vitest.runtime.snapshot.environment", async () => {
|
|
71
|
+
if (!workerState.config.snapshotOptions.snapshotEnvironment) workerState.config.snapshotOptions.snapshotEnvironment = await resolveSnapshotEnvironment(config, moduleRunner);
|
|
72
|
+
})
|
|
73
|
+
]);
|
|
74
|
+
workerState.onCancel((reason) => {
|
|
75
|
+
closeInspector(config);
|
|
76
|
+
testRunner.cancel?.(reason);
|
|
77
|
+
});
|
|
78
|
+
workerState.durations.prepare = performance$1.now() - workerState.durations.prepare;
|
|
79
|
+
await traces.$(`vitest.test.runner.${method}`, async () => {
|
|
80
|
+
for (const file of files) {
|
|
81
|
+
if (config.isolate) {
|
|
82
|
+
moduleRunner.mocker.reset();
|
|
83
|
+
resetModules(workerState.evaluatedModules, true);
|
|
84
|
+
}
|
|
85
|
+
workerState.filepath = file.filepath;
|
|
86
|
+
if (method === "run") await traces.$(`vitest.test.runner.${method}.module`, { attributes: { "code.file.path": file.filepath } }, () => startTests([file], testRunner));
|
|
87
|
+
else await traces.$(`vitest.test.runner.${method}.module`, { attributes: { "code.file.path": file.filepath } }, () => collectTests([file], testRunner));
|
|
88
|
+
// reset after tests, because user might call `vi.setConfig` in setupFile
|
|
89
|
+
vi.resetConfig();
|
|
90
|
+
// mocks should not affect different files
|
|
91
|
+
vi.restoreAllMocks();
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
await traces.$("vitest.runtime.coverage.stop", () => stopCoverageInsideWorker(config.coverage, moduleRunner, { isolate: config.isolate }));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
let _moduleRunner;
|
|
98
|
+
const evaluatedModules = new VitestEvaluatedModules();
|
|
99
|
+
const moduleExecutionInfo = /* @__PURE__ */ new Map();
|
|
100
|
+
function startModuleRunner(options) {
|
|
101
|
+
if (_moduleRunner) return _moduleRunner;
|
|
102
|
+
_moduleRunner = startVitestModuleRunner(options);
|
|
103
|
+
return _moduleRunner;
|
|
104
|
+
}
|
|
105
|
+
let _currentEnvironment;
|
|
106
|
+
let _environmentTime;
|
|
107
|
+
/** @experimental */
|
|
108
|
+
async function setupEnvironment(context) {
|
|
109
|
+
const startTime = performance.now();
|
|
110
|
+
const { environment: { name: environmentName, options: environmentOptions }, rpc, config } = context;
|
|
111
|
+
// we could load @vite/env, but it would take ~8ms, while this takes ~0,02ms
|
|
112
|
+
if (context.config.serializedDefines) try {
|
|
113
|
+
runInThisContext(`(() =>{\n${context.config.serializedDefines}})()`, {
|
|
114
|
+
lineOffset: 1,
|
|
115
|
+
filename: "virtual:load-defines.js"
|
|
116
|
+
});
|
|
117
|
+
} catch (error) {
|
|
118
|
+
throw new Error(`Failed to load custom "defines": ${error.message}`);
|
|
119
|
+
}
|
|
120
|
+
const otel = context.traces;
|
|
121
|
+
const { environment, loader } = await loadEnvironment(environmentName, config.root, rpc, otel);
|
|
122
|
+
_currentEnvironment = environment;
|
|
123
|
+
const env = await otel.$("vitest.runtime.environment.setup", { attributes: {
|
|
124
|
+
"vitest.environment": environment.name,
|
|
125
|
+
"vitest.environment.vite_environment": environment.viteEnvironment || environment.name
|
|
126
|
+
} }, () => environment.setup(globalThis, environmentOptions || config.environmentOptions || {}));
|
|
127
|
+
_environmentTime = performance.now() - startTime;
|
|
128
|
+
if (config.chaiConfig) setupChaiConfig(config.chaiConfig);
|
|
129
|
+
return async () => {
|
|
130
|
+
await otel.$("vitest.runtime.environment.teardown", () => env.teardown(globalThis));
|
|
131
|
+
await loader?.close();
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/** @experimental */
|
|
135
|
+
async function runBaseTests(method, state, traces) {
|
|
136
|
+
const { ctx } = state;
|
|
137
|
+
state.environment = _currentEnvironment;
|
|
138
|
+
state.durations.environment = _environmentTime;
|
|
139
|
+
// state has new context, but we want to reuse existing ones
|
|
140
|
+
state.evaluatedModules = evaluatedModules;
|
|
141
|
+
state.moduleExecutionInfo = moduleExecutionInfo;
|
|
142
|
+
provideWorkerState(globalThis, state);
|
|
143
|
+
if (ctx.invalidates) ctx.invalidates.forEach((filepath) => {
|
|
144
|
+
(state.evaluatedModules.fileToModulesMap.get(filepath) || []).forEach((module) => {
|
|
145
|
+
state.evaluatedModules.invalidateModule(module);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
ctx.files.forEach((i) => {
|
|
149
|
+
const filepath = i.filepath;
|
|
150
|
+
(state.evaluatedModules.fileToModulesMap.get(filepath) || []).forEach((module) => {
|
|
151
|
+
state.evaluatedModules.invalidateModule(module);
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
const moduleRunner = startModuleRunner({
|
|
155
|
+
state,
|
|
156
|
+
evaluatedModules: state.evaluatedModules,
|
|
157
|
+
spyModule,
|
|
158
|
+
createImportMeta: createNodeImportMeta,
|
|
159
|
+
traces
|
|
160
|
+
});
|
|
161
|
+
emitModuleRunner(moduleRunner);
|
|
162
|
+
await run(method, ctx.files, ctx.config, moduleRunner, _currentEnvironment, traces);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export { runBaseTests as r, setupEnvironment as s };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getCurrentSuite } from '../@vitest/runner/index.js';
|
|
2
|
+
import { createChainable } from '../@vitest/runner/utils.js';
|
|
3
|
+
import { noop } from '../@vitest/utils/helpers.js';
|
|
4
|
+
import { g as getWorkerState } from './utils.DvEY5TfP.js';
|
|
5
|
+
|
|
6
|
+
const benchFns = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
const benchOptsMap = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
function getBenchOptions(key) {
|
|
9
|
+
return benchOptsMap.get(key);
|
|
10
|
+
}
|
|
11
|
+
function getBenchFn(key) {
|
|
12
|
+
return benchFns.get(key);
|
|
13
|
+
}
|
|
14
|
+
const bench = createBenchmark(function(name, fn = noop, options = {}) {
|
|
15
|
+
if (getWorkerState().config.mode !== "benchmark") throw new Error("`bench()` is only available in benchmark mode.");
|
|
16
|
+
const task = getCurrentSuite().task(formatName(name), {
|
|
17
|
+
...this,
|
|
18
|
+
meta: { benchmark: true }
|
|
19
|
+
});
|
|
20
|
+
benchFns.set(task, fn);
|
|
21
|
+
benchOptsMap.set(task, options);
|
|
22
|
+
// vitest runner sets mode to `todo` if handler is not passed down
|
|
23
|
+
// but we store handler separetly
|
|
24
|
+
if (!this.todo && task.mode === "todo") task.mode = "run";
|
|
25
|
+
});
|
|
26
|
+
function createBenchmark(fn) {
|
|
27
|
+
const benchmark = createChainable([
|
|
28
|
+
"skip",
|
|
29
|
+
"only",
|
|
30
|
+
"todo"
|
|
31
|
+
], fn);
|
|
32
|
+
benchmark.skipIf = (condition) => condition ? benchmark.skip : benchmark;
|
|
33
|
+
benchmark.runIf = (condition) => condition ? benchmark : benchmark.skip;
|
|
34
|
+
return benchmark;
|
|
35
|
+
}
|
|
36
|
+
function formatName(name) {
|
|
37
|
+
return typeof name === "string" ? name : typeof name === "function" ? name.name || "<anonymous>" : String(name);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { getBenchOptions as a, bench as b, getBenchFn as g };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Test } from '../@vitest/runner/index.js';
|
|
2
|
+
import { ChainableFunction } from '../@vitest/runner/utils.js';
|
|
3
|
+
import { TaskResult, Bench, Options } from '../vendor/tinybench.mjs';
|
|
4
|
+
|
|
5
|
+
interface Benchmark extends Test {
|
|
6
|
+
meta: {
|
|
7
|
+
benchmark: true;
|
|
8
|
+
result?: TaskResult;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface BenchmarkResult extends TaskResult {
|
|
12
|
+
name: string;
|
|
13
|
+
rank: number;
|
|
14
|
+
sampleCount: number;
|
|
15
|
+
median: number;
|
|
16
|
+
}
|
|
17
|
+
type BenchFunction = (this: Bench) => Promise<void> | void;
|
|
18
|
+
type ChainableBenchmarkAPI = ChainableFunction<"skip" | "only" | "todo", (name: string | Function, fn?: BenchFunction, options?: Options) => void>;
|
|
19
|
+
type BenchmarkAPI = ChainableBenchmarkAPI & {
|
|
20
|
+
skipIf: (condition: any) => ChainableBenchmarkAPI;
|
|
21
|
+
runIf: (condition: any) => ChainableBenchmarkAPI;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type { BenchmarkResult as B, BenchFunction as a, Benchmark as b, BenchmarkAPI as c };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { FileSpecification } from '../@vitest/runner/index.js';
|
|
2
|
+
import { O as OTELCarrier } from './traces.d.402V_yFI.js';
|
|
3
|
+
import { T as TestExecutionMethod } from './worker.d.Dyxm8DEL.js';
|
|
4
|
+
|
|
5
|
+
type SerializedTestSpecification = [project: {
|
|
6
|
+
name: string | undefined;
|
|
7
|
+
root: string;
|
|
8
|
+
}, file: string, options: {
|
|
9
|
+
pool: string;
|
|
10
|
+
testLines?: number[] | undefined;
|
|
11
|
+
}];
|
|
12
|
+
|
|
13
|
+
interface ModuleDefinitionLocation {
|
|
14
|
+
line: number;
|
|
15
|
+
column: number;
|
|
16
|
+
}
|
|
17
|
+
interface SourceModuleLocations {
|
|
18
|
+
modules: ModuleDefinitionDiagnostic[];
|
|
19
|
+
untracked: ModuleDefinitionDiagnostic[];
|
|
20
|
+
}
|
|
21
|
+
interface ModuleDefinitionDiagnostic {
|
|
22
|
+
start: ModuleDefinitionLocation;
|
|
23
|
+
end: ModuleDefinitionLocation;
|
|
24
|
+
startIndex: number;
|
|
25
|
+
endIndex: number;
|
|
26
|
+
rawUrl: string;
|
|
27
|
+
resolvedUrl: string;
|
|
28
|
+
resolvedId: string;
|
|
29
|
+
}
|
|
30
|
+
interface ModuleDefinitionDurationsDiagnostic extends ModuleDefinitionDiagnostic {
|
|
31
|
+
selfTime: number;
|
|
32
|
+
totalTime: number;
|
|
33
|
+
transformTime?: number;
|
|
34
|
+
external?: boolean;
|
|
35
|
+
importer?: string;
|
|
36
|
+
}
|
|
37
|
+
interface UntrackedModuleDefinitionDiagnostic {
|
|
38
|
+
url: string;
|
|
39
|
+
resolvedId: string;
|
|
40
|
+
resolvedUrl: string;
|
|
41
|
+
selfTime: number;
|
|
42
|
+
totalTime: number;
|
|
43
|
+
transformTime?: number;
|
|
44
|
+
external?: boolean;
|
|
45
|
+
importer?: string;
|
|
46
|
+
}
|
|
47
|
+
interface SourceModuleDiagnostic {
|
|
48
|
+
modules: ModuleDefinitionDurationsDiagnostic[];
|
|
49
|
+
untrackedModules: UntrackedModuleDefinitionDiagnostic[];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface BrowserTesterOptions {
|
|
53
|
+
method: TestExecutionMethod;
|
|
54
|
+
files: FileSpecification[];
|
|
55
|
+
providedContext: string;
|
|
56
|
+
otelCarrier?: OTELCarrier;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type { BrowserTesterOptions as B, ModuleDefinitionDurationsDiagnostic as M, SerializedTestSpecification as S, UntrackedModuleDefinitionDiagnostic as U, ModuleDefinitionDiagnostic as a, ModuleDefinitionLocation as b, SourceModuleDiagnostic as c, SourceModuleLocations as d };
|