vitest 0.25.2 → 0.25.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/LICENSE.md +47 -2
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +4 -4
- package/dist/{chunk-api-setup.c5a9009c.js → chunk-api-setup.c9f38753.js} +2 -2
- package/dist/{chunk-integrations-globals.06c8d418.js → chunk-integrations-globals.1e636d22.js} +2 -2
- package/dist/{chunk-runtime-chain.a0b441dc.js → chunk-runtime-chain.f993b1dc.js} +17 -2
- package/dist/{chunk-runtime-mocker.a5151f99.js → chunk-runtime-mocker.c4d85347.js} +3 -3
- package/dist/{chunk-runtime-setup.419ccdd8.js → chunk-runtime-setup.667a5719.js} +7 -7
- package/dist/{chunk-runtime-test-state.3cbc4575.js → chunk-runtime-test-state.de4d6ff8.js} +71 -34
- package/dist/{chunk-vite-node-client.85cc7113.js → chunk-vite-node-client.58cb6bfa.js} +1 -1
- package/dist/{chunk-vite-node-externalize.72a4d20b.js → chunk-vite-node-externalize.c57d0ad1.js} +9 -8
- package/dist/{chunk-vite-node-utils.8f0b4a12.js → chunk-vite-node-utils.f6d73fbe.js} +104 -106
- package/dist/cli.js +9 -6
- package/dist/config.d.ts +1 -1
- package/dist/entry.js +3 -3
- package/dist/environments.d.ts +1 -1
- package/dist/{index-2f5b6168.d.ts → index-9f5bc072.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/loader.js +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.js +4 -4
- package/dist/suite.js +1 -1
- package/dist/{types-f302dae9.d.ts → types-de0e0997.d.ts} +1 -0
- package/dist/worker.js +3 -3
- package/package.json +5 -5
package/LICENSE.md
CHANGED
|
@@ -1510,7 +1510,7 @@ Repository: unjs/mlly
|
|
|
1510
1510
|
|
|
1511
1511
|
> MIT License
|
|
1512
1512
|
>
|
|
1513
|
-
> Copyright (c)
|
|
1513
|
+
> Copyright (c) Pooya Parsa <pooya@pi0.io>
|
|
1514
1514
|
>
|
|
1515
1515
|
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1516
1516
|
> of this software and associated documentation files (the "Software"), to deal
|
|
@@ -1748,6 +1748,51 @@ Repository: micromatch/picomatch
|
|
|
1748
1748
|
License: MIT
|
|
1749
1749
|
Repository: unjs/pkg-types
|
|
1750
1750
|
|
|
1751
|
+
> MIT License
|
|
1752
|
+
>
|
|
1753
|
+
> Copyright (c) Pooya Parsa <pooya@pi0.io>
|
|
1754
|
+
>
|
|
1755
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1756
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
1757
|
+
> in the Software without restriction, including without limitation the rights
|
|
1758
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1759
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
1760
|
+
> furnished to do so, subject to the following conditions:
|
|
1761
|
+
>
|
|
1762
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
1763
|
+
> copies or substantial portions of the Software.
|
|
1764
|
+
>
|
|
1765
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1766
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1767
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1768
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1769
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1770
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1771
|
+
> SOFTWARE.
|
|
1772
|
+
>
|
|
1773
|
+
> --------------------------------------------------------------------------------
|
|
1774
|
+
>
|
|
1775
|
+
> Copyright Joyent, Inc. and other Node contributors.
|
|
1776
|
+
>
|
|
1777
|
+
> Permission is hereby granted, free of charge, to any person obtaining a
|
|
1778
|
+
> copy of this software and associated documentation files (the
|
|
1779
|
+
> "Software"), to deal in the Software without restriction, including
|
|
1780
|
+
> without limitation the rights to use, copy, modify, merge, publish,
|
|
1781
|
+
> distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
1782
|
+
> persons to whom the Software is furnished to do so, subject to the
|
|
1783
|
+
> following conditions:
|
|
1784
|
+
>
|
|
1785
|
+
> The above copyright notice and this permission notice shall be included
|
|
1786
|
+
> in all copies or substantial portions of the Software.
|
|
1787
|
+
>
|
|
1788
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
1789
|
+
> OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
1790
|
+
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
1791
|
+
> NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
1792
|
+
> DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
1793
|
+
> OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
1794
|
+
> USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1795
|
+
|
|
1751
1796
|
---------------------------------------
|
|
1752
1797
|
|
|
1753
1798
|
## pretty-format
|
|
@@ -2212,7 +2257,7 @@ Repository: unjs/ufo
|
|
|
2212
2257
|
|
|
2213
2258
|
> MIT License
|
|
2214
2259
|
>
|
|
2215
|
-
> Copyright (c)
|
|
2260
|
+
> Copyright (c) Pooya Parsa <pooya@pi0.io>
|
|
2216
2261
|
>
|
|
2217
2262
|
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2218
2263
|
> of this software and associated documentation files (the "Software"), to deal
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-
|
|
2
|
-
import { b as ResolvedConfig } from './types-
|
|
3
|
-
export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-
|
|
1
|
+
export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-9f5bc072.js';
|
|
2
|
+
import { b as ResolvedConfig } from './types-de0e0997.js';
|
|
3
|
+
export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-de0e0997.js';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
package/dist/browser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.
|
|
2
|
-
import { e as dist } from './chunk-runtime-test-state.
|
|
3
|
-
export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-runtime-test-state.
|
|
4
|
-
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.
|
|
1
|
+
export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.f993b1dc.js';
|
|
2
|
+
import { e as dist } from './chunk-runtime-test-state.de4d6ff8.js';
|
|
3
|
+
export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-runtime-test-state.de4d6ff8.js';
|
|
4
|
+
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.667a5719.js';
|
|
5
5
|
import * as chai from 'chai';
|
|
6
6
|
export { chai };
|
|
7
7
|
export { assert, should } from 'chai';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import { c as createBirpc } from './chunk-vite-node-client.
|
|
2
|
+
import { c as createBirpc } from './chunk-vite-node-client.58cb6bfa.js';
|
|
3
3
|
import require$$0$1 from 'stream';
|
|
4
4
|
import require$$0 from 'zlib';
|
|
5
5
|
import require$$3 from 'net';
|
|
@@ -12,7 +12,7 @@ import url from 'url';
|
|
|
12
12
|
import { A as API_PATH } from './chunk-utils-env.03f840f2.js';
|
|
13
13
|
import 'module';
|
|
14
14
|
import 'vm';
|
|
15
|
-
import './chunk-vite-node-utils.
|
|
15
|
+
import './chunk-vite-node-utils.f6d73fbe.js';
|
|
16
16
|
import 'acorn';
|
|
17
17
|
import 'path';
|
|
18
18
|
import 'assert';
|
package/dist/{chunk-integrations-globals.06c8d418.js → chunk-integrations-globals.1e636d22.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { m as globalApis } from './chunk-utils-env.03f840f2.js';
|
|
2
|
-
import { i as index } from './chunk-runtime-test-state.
|
|
2
|
+
import { i as index } from './chunk-runtime-test-state.de4d6ff8.js';
|
|
3
3
|
import 'tty';
|
|
4
4
|
import 'url';
|
|
5
5
|
import 'path';
|
|
6
|
-
import './chunk-runtime-chain.
|
|
6
|
+
import './chunk-runtime-chain.f993b1dc.js';
|
|
7
7
|
import 'util';
|
|
8
8
|
import './chunk-typecheck-constants.4891f22f.js';
|
|
9
9
|
import 'local-pkg';
|
|
@@ -2353,8 +2353,10 @@ function createSuite() {
|
|
|
2353
2353
|
const mode = this.only ? "only" : this.skip ? "skip" : this.todo ? "todo" : "run";
|
|
2354
2354
|
return createSuiteCollector(name, factory, mode, this.concurrent, this.shuffle, options);
|
|
2355
2355
|
}
|
|
2356
|
-
suiteFn.each = function(cases) {
|
|
2356
|
+
suiteFn.each = function(cases, ...args) {
|
|
2357
2357
|
const suite2 = this.withContext();
|
|
2358
|
+
if (Array.isArray(cases) && args.length)
|
|
2359
|
+
cases = formatTemplateString(cases, args);
|
|
2358
2360
|
return (name, fn, options) => {
|
|
2359
2361
|
const arrayOnlyCases = cases.every(Array.isArray);
|
|
2360
2362
|
cases.forEach((i, idx) => {
|
|
@@ -2372,8 +2374,10 @@ function createSuite() {
|
|
|
2372
2374
|
}
|
|
2373
2375
|
function createTest(fn) {
|
|
2374
2376
|
const testFn = fn;
|
|
2375
|
-
testFn.each = function(cases) {
|
|
2377
|
+
testFn.each = function(cases, ...args) {
|
|
2376
2378
|
const test2 = this.withContext();
|
|
2379
|
+
if (Array.isArray(cases) && args.length)
|
|
2380
|
+
cases = formatTemplateString(cases, args);
|
|
2377
2381
|
return (name, fn2, options) => {
|
|
2378
2382
|
const arrayOnlyCases = cases.every(Array.isArray);
|
|
2379
2383
|
cases.forEach((i, idx) => {
|
|
@@ -2411,5 +2415,16 @@ function formatTitle(template, items, idx) {
|
|
|
2411
2415
|
}
|
|
2412
2416
|
return formatted;
|
|
2413
2417
|
}
|
|
2418
|
+
function formatTemplateString(cases, args) {
|
|
2419
|
+
const header = cases.join("").trim().replace(/ /g, "").split("\n").map((i) => i.split("|"))[0];
|
|
2420
|
+
const res = [];
|
|
2421
|
+
for (let i = 0; i < Math.floor(args.length / header.length); i++) {
|
|
2422
|
+
const oneCase = {};
|
|
2423
|
+
for (let j = 0; j < header.length; j++)
|
|
2424
|
+
oneCase[header[j]] = args[i * header.length + j];
|
|
2425
|
+
res.push(oneCase);
|
|
2426
|
+
}
|
|
2427
|
+
return res;
|
|
2428
|
+
}
|
|
2414
2429
|
|
|
2415
2430
|
export { GLOBAL_EXPECT as G, getDefaultHookTimeout as a, bench as b, createExpect as c, describe as d, globalExpect as e, clearCollectorContext as f, getCurrentSuite as g, defaultSuite as h, it as i, setHooks as j, getHooks as k, collectorContext as l, getBenchOptions as m, getFn as n, setState as o, getState as p, createSuiteHooks as q, chai$1 as r, suite as s, test as t, withTimeout as w };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { V as ViteNodeRunner } from './chunk-vite-node-client.
|
|
1
|
+
import { V as ViteNodeRunner } from './chunk-vite-node-client.58cb6bfa.js';
|
|
2
2
|
import { normalizePath } from 'vite';
|
|
3
3
|
import { g as getWorkerState, H as mergeSlashes, s as slash, w as getType, I as getAllMockableProperties } from './chunk-typecheck-constants.4891f22f.js';
|
|
4
4
|
import { existsSync, readdirSync } from 'fs';
|
|
5
|
-
import { n as normalizeRequestId, p as pathFromRoot, i as isNodeBuiltin, b as toFilePath } from './chunk-vite-node-utils.
|
|
5
|
+
import { n as normalizeRequestId, p as pathFromRoot, i as isNodeBuiltin, b as toFilePath } from './chunk-vite-node-utils.f6d73fbe.js';
|
|
6
6
|
import { d as dirname, j as join, c as basename, l as extname, b as resolve, e as distDir } from './chunk-utils-env.03f840f2.js';
|
|
7
7
|
|
|
8
8
|
class RefTracker {
|
|
@@ -205,7 +205,7 @@ const _VitestMocker = class {
|
|
|
205
205
|
const suitefile = this.getSuiteFilepath();
|
|
206
206
|
const id = this.normalizePath(path);
|
|
207
207
|
const mock = this.mockMap.get(suitefile);
|
|
208
|
-
if (mock
|
|
208
|
+
if (mock && id in mock)
|
|
209
209
|
delete mock[id];
|
|
210
210
|
const mockId = this.getMockPath(id);
|
|
211
211
|
if (this.moduleCache.get(mockId))
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { performance } from 'perf_hooks';
|
|
2
2
|
import { s as someTasksAreOnly, i as interpretTaskModes, t as takeCoverageInsideWorker, p as pLimit } from './chunk-integrations-coverage.befed097.js';
|
|
3
|
-
import { r as resetRunOnceCounter, i as index, v as vi, s as setCurrentTest } from './chunk-runtime-test-state.
|
|
3
|
+
import { r as resetRunOnceCounter, i as index, v as vi, s as setCurrentTest } from './chunk-runtime-test-state.de4d6ff8.js';
|
|
4
4
|
import { g as getWorkerState, R as RealDate, t as toArray, k as relativePath, h as isRunningInBenchmark, p as partitionSuiteChildren, l as shuffle, o as hasTests, q as hasFailed, u as createDefer, e as getFullName } from './chunk-typecheck-constants.4891f22f.js';
|
|
5
|
-
import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as getBenchOptions, n as getFn, o as setState, G as GLOBAL_EXPECT, p as getState } from './chunk-runtime-chain.
|
|
5
|
+
import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as getBenchOptions, n as getFn, o as setState, G as GLOBAL_EXPECT, p as getState } from './chunk-runtime-chain.f993b1dc.js';
|
|
6
6
|
import { r as rpc } from './chunk-runtime-rpc.1e7530d3.js';
|
|
7
7
|
import { p as processError } from './chunk-runtime-error.6287172c.js';
|
|
8
8
|
import require$$0 from 'source-map';
|
|
@@ -750,7 +750,7 @@ async function setupGlobalEnv(config) {
|
|
|
750
750
|
await setupConsoleLogSpy();
|
|
751
751
|
}
|
|
752
752
|
if (config.globals)
|
|
753
|
-
(await import('./chunk-integrations-globals.
|
|
753
|
+
(await import('./chunk-integrations-globals.1e636d22.js')).registerApiGlobally();
|
|
754
754
|
}
|
|
755
755
|
function setupDefines(defines) {
|
|
756
756
|
for (const key in defines)
|
|
@@ -1050,7 +1050,7 @@ const callCleanupHooks = async (cleanups) => {
|
|
|
1050
1050
|
async function runTest(test) {
|
|
1051
1051
|
var _a, _b, _c;
|
|
1052
1052
|
if (test.mode !== "run") {
|
|
1053
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
1053
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.f993b1dc.js').then(function (n) { return n.r; });
|
|
1054
1054
|
getSnapshotClient().skipTestSnapshots(test);
|
|
1055
1055
|
return;
|
|
1056
1056
|
}
|
|
@@ -1067,7 +1067,7 @@ async function runTest(test) {
|
|
|
1067
1067
|
clearModuleMocks();
|
|
1068
1068
|
setCurrentTest(test);
|
|
1069
1069
|
if (isNode) {
|
|
1070
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
1070
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.f993b1dc.js').then(function (n) { return n.r; });
|
|
1071
1071
|
await getSnapshotClient().setTest(test);
|
|
1072
1072
|
}
|
|
1073
1073
|
const workerState = getWorkerState();
|
|
@@ -1130,7 +1130,7 @@ async function runTest(test) {
|
|
|
1130
1130
|
console.error(test.result.error.message, test.result.error.stackStr);
|
|
1131
1131
|
setCurrentTest(void 0);
|
|
1132
1132
|
if (isNode) {
|
|
1133
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
1133
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.f993b1dc.js').then(function (n) { return n.r; });
|
|
1134
1134
|
getSnapshotClient().clearTest();
|
|
1135
1135
|
}
|
|
1136
1136
|
test.result.duration = now() - start;
|
|
@@ -1336,7 +1336,7 @@ async function startTestsBrowser(paths, config) {
|
|
|
1336
1336
|
async function startTestsNode(paths, config) {
|
|
1337
1337
|
const files = await collectTests(paths, config);
|
|
1338
1338
|
rpc().onCollected(files);
|
|
1339
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
1339
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.f993b1dc.js').then(function (n) { return n.r; });
|
|
1340
1340
|
getSnapshotClient().clear();
|
|
1341
1341
|
await runFiles(files, config);
|
|
1342
1342
|
const coverage = await takeCoverageInsideWorker(config.coverage);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, b as bench, c as createExpect, e as globalExpect } from './chunk-runtime-chain.
|
|
1
|
+
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, b as bench, c as createExpect, e as globalExpect } from './chunk-runtime-chain.f993b1dc.js';
|
|
2
2
|
import { g as getWorkerState, R as RealDate, r as resetDate, m as mockDate, a as resetModules } from './chunk-typecheck-constants.4891f22f.js';
|
|
3
3
|
import { p as parseStacktrace } from './chunk-utils-source-map.c6dfbbc1.js';
|
|
4
4
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
|
|
@@ -89,27 +89,71 @@ if (typeof commonjsGlobal !== "undefined") {
|
|
|
89
89
|
|
|
90
90
|
var global = globalObject$1;
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Is true when the environment causes an error to be thrown for accessing the
|
|
94
|
+
* __proto__ property.
|
|
95
|
+
*
|
|
96
|
+
* This is necessary in order to support `node --disable-proto=throw`.
|
|
97
|
+
*
|
|
98
|
+
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
|
|
99
|
+
*
|
|
100
|
+
* @type {boolean}
|
|
101
|
+
*/
|
|
102
|
+
let throwsOnProto$1;
|
|
103
|
+
try {
|
|
104
|
+
const object = {};
|
|
105
|
+
// eslint-disable-next-line no-proto, no-unused-expressions
|
|
106
|
+
object.__proto__;
|
|
107
|
+
throwsOnProto$1 = false;
|
|
108
|
+
} catch (_) {
|
|
109
|
+
// This branch is covered when tests are run with `--disable-proto=throw`,
|
|
110
|
+
// however we can test both branches at the same time, so this is ignored
|
|
111
|
+
/* istanbul ignore next */
|
|
112
|
+
throwsOnProto$1 = true;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
var throwsOnProto_1 = throwsOnProto$1;
|
|
116
|
+
|
|
92
117
|
var call = Function.call;
|
|
118
|
+
var throwsOnProto = throwsOnProto_1;
|
|
119
|
+
|
|
120
|
+
var disallowedProperties = [
|
|
121
|
+
// ignore size because it throws from Map
|
|
122
|
+
"size",
|
|
123
|
+
"caller",
|
|
124
|
+
"callee",
|
|
125
|
+
"arguments",
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
// This branch is covered when tests are run with `--disable-proto=throw`,
|
|
129
|
+
// however we can test both branches at the same time, so this is ignored
|
|
130
|
+
/* istanbul ignore next */
|
|
131
|
+
if (throwsOnProto) {
|
|
132
|
+
disallowedProperties.push("__proto__");
|
|
133
|
+
}
|
|
93
134
|
|
|
94
|
-
var
|
|
135
|
+
var copyPrototypeMethods = function copyPrototypeMethods(prototype) {
|
|
95
136
|
// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
|
|
96
|
-
return Object.getOwnPropertyNames(prototype).reduce(function(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
name !== "arguments" &&
|
|
103
|
-
typeof prototype[name] === "function"
|
|
104
|
-
) {
|
|
105
|
-
result[name] = call.bind(prototype[name]);
|
|
137
|
+
return Object.getOwnPropertyNames(prototype).reduce(function (
|
|
138
|
+
result,
|
|
139
|
+
name
|
|
140
|
+
) {
|
|
141
|
+
if (disallowedProperties.includes(name)) {
|
|
142
|
+
return result;
|
|
106
143
|
}
|
|
107
144
|
|
|
145
|
+
if (typeof prototype[name] !== "function") {
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
result[name] = call.bind(prototype[name]);
|
|
150
|
+
|
|
108
151
|
return result;
|
|
109
|
-
},
|
|
152
|
+
},
|
|
153
|
+
Object.create(null));
|
|
110
154
|
};
|
|
111
155
|
|
|
112
|
-
var copyPrototype$5 =
|
|
156
|
+
var copyPrototype$5 = copyPrototypeMethods;
|
|
113
157
|
|
|
114
158
|
var array = copyPrototype$5(Array.prototype);
|
|
115
159
|
|
|
@@ -237,8 +281,8 @@ var deprecated = {};
|
|
|
237
281
|
* @param {string} msg
|
|
238
282
|
* @returns {Function}
|
|
239
283
|
*/
|
|
240
|
-
exports.wrap = function(func, msg) {
|
|
241
|
-
var wrapped = function() {
|
|
284
|
+
exports.wrap = function (func, msg) {
|
|
285
|
+
var wrapped = function () {
|
|
242
286
|
exports.printWarning(msg);
|
|
243
287
|
return func.apply(this, arguments);
|
|
244
288
|
};
|
|
@@ -256,15 +300,8 @@ var deprecated = {};
|
|
|
256
300
|
* @param {string} funcName
|
|
257
301
|
* @returns {string}
|
|
258
302
|
*/
|
|
259
|
-
exports.defaultMsg = function(packageName, funcName) {
|
|
260
|
-
return
|
|
261
|
-
packageName +
|
|
262
|
-
"." +
|
|
263
|
-
funcName +
|
|
264
|
-
" is deprecated and will be removed from the public API in a future version of " +
|
|
265
|
-
packageName +
|
|
266
|
-
"."
|
|
267
|
-
);
|
|
303
|
+
exports.defaultMsg = function (packageName, funcName) {
|
|
304
|
+
return `${packageName}.${funcName} is deprecated and will be removed from the public API in a future version of ${packageName}.`;
|
|
268
305
|
};
|
|
269
306
|
|
|
270
307
|
/**
|
|
@@ -273,7 +310,7 @@ var deprecated = {};
|
|
|
273
310
|
* @param {string} msg
|
|
274
311
|
* @returns {undefined}
|
|
275
312
|
*/
|
|
276
|
-
exports.printWarning = function(msg) {
|
|
313
|
+
exports.printWarning = function (msg) {
|
|
277
314
|
/* istanbul ignore next */
|
|
278
315
|
if (typeof process === "object" && process.emitWarning) {
|
|
279
316
|
// Emit Warnings in Node
|
|
@@ -299,7 +336,7 @@ var every = function every(obj, fn) {
|
|
|
299
336
|
|
|
300
337
|
try {
|
|
301
338
|
// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
|
|
302
|
-
obj.forEach(function() {
|
|
339
|
+
obj.forEach(function () {
|
|
303
340
|
if (!fn.apply(this, arguments)) {
|
|
304
341
|
// Throwing an error is the only way to break `forEach`
|
|
305
342
|
throw new Error();
|
|
@@ -347,23 +384,23 @@ function orderByFirstCall(spies) {
|
|
|
347
384
|
|
|
348
385
|
var orderByFirstCall_1 = orderByFirstCall;
|
|
349
386
|
|
|
350
|
-
var copyPrototype$4 =
|
|
387
|
+
var copyPrototype$4 = copyPrototypeMethods;
|
|
351
388
|
|
|
352
389
|
var _function = copyPrototype$4(Function.prototype);
|
|
353
390
|
|
|
354
|
-
var copyPrototype$3 =
|
|
391
|
+
var copyPrototype$3 = copyPrototypeMethods;
|
|
355
392
|
|
|
356
393
|
var map = copyPrototype$3(Map.prototype);
|
|
357
394
|
|
|
358
|
-
var copyPrototype$2 =
|
|
395
|
+
var copyPrototype$2 = copyPrototypeMethods;
|
|
359
396
|
|
|
360
397
|
var object = copyPrototype$2(Object.prototype);
|
|
361
398
|
|
|
362
|
-
var copyPrototype$1 =
|
|
399
|
+
var copyPrototype$1 = copyPrototypeMethods;
|
|
363
400
|
|
|
364
401
|
var set = copyPrototype$1(Set.prototype);
|
|
365
402
|
|
|
366
|
-
var copyPrototype =
|
|
403
|
+
var copyPrototype = copyPrototypeMethods;
|
|
367
404
|
|
|
368
405
|
var string = copyPrototype(String.prototype);
|
|
369
406
|
|
|
@@ -373,7 +410,7 @@ var prototypes = {
|
|
|
373
410
|
map: map,
|
|
374
411
|
object: object,
|
|
375
412
|
set: set,
|
|
376
|
-
string: string
|
|
413
|
+
string: string,
|
|
377
414
|
};
|
|
378
415
|
|
|
379
416
|
var typeDetect = {exports: {}};
|
|
@@ -804,7 +841,7 @@ var lib = {
|
|
|
804
841
|
orderByFirstCall: orderByFirstCall_1,
|
|
805
842
|
prototypes: prototypes,
|
|
806
843
|
typeOf: typeOf,
|
|
807
|
-
valueToString: valueToString_1
|
|
844
|
+
valueToString: valueToString_1,
|
|
808
845
|
};
|
|
809
846
|
|
|
810
847
|
const globalObject = lib.global;
|
|
@@ -2,7 +2,7 @@ import { createRequire } from 'module';
|
|
|
2
2
|
import { pathToFileURL, fileURLToPath } from 'url';
|
|
3
3
|
import vm from 'vm';
|
|
4
4
|
import { b as resolve, d as dirname, g as isAbsolute, l as extname } from './chunk-utils-env.03f840f2.js';
|
|
5
|
-
import { s as slash, n as normalizeRequestId, b as toFilePath, c as isPrimitive, i as isNodeBuiltin, d as normalizeModuleId, m as mergeSlashes } from './chunk-vite-node-utils.
|
|
5
|
+
import { s as slash, n as normalizeRequestId, b as toFilePath, c as isPrimitive, i as isNodeBuiltin, d as normalizeModuleId, m as mergeSlashes } from './chunk-vite-node-utils.f6d73fbe.js';
|
|
6
6
|
import createDebug from 'debug';
|
|
7
7
|
|
|
8
8
|
const debugExecute = createDebug("vite-node:client:execute");
|
package/dist/{chunk-vite-node-externalize.72a4d20b.js → chunk-vite-node-externalize.c57d0ad1.js}
RENAMED
|
@@ -12,10 +12,10 @@ import util$2 from 'util';
|
|
|
12
12
|
import require$$0$1 from 'stream';
|
|
13
13
|
import require$$2 from 'events';
|
|
14
14
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
|
|
15
|
-
import { c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-client.
|
|
15
|
+
import { c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-client.58cb6bfa.js';
|
|
16
16
|
import { performance } from 'perf_hooks';
|
|
17
17
|
import createDebug from 'debug';
|
|
18
|
-
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, b as toFilePath, w as withInlineSourcemap } from './chunk-vite-node-utils.
|
|
18
|
+
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, b as toFilePath, w as withInlineSourcemap } from './chunk-vite-node-utils.f6d73fbe.js';
|
|
19
19
|
import { writeFile, rm } from 'fs/promises';
|
|
20
20
|
import { e as execa } from './vendor-index.737c3cff.js';
|
|
21
21
|
import { SourceMapConsumer } from 'source-map';
|
|
@@ -35,7 +35,7 @@ import { stripLiteral } from 'strip-literal';
|
|
|
35
35
|
import require$$0$2 from 'readline';
|
|
36
36
|
import { p as prompts } from './vendor-index.9f20a9be.js';
|
|
37
37
|
|
|
38
|
-
var version$1 = "0.25.
|
|
38
|
+
var version$1 = "0.25.3";
|
|
39
39
|
|
|
40
40
|
class EndError extends Error {
|
|
41
41
|
constructor(value) {
|
|
@@ -8798,7 +8798,7 @@ class JUnitReporter {
|
|
|
8798
8798
|
await this.writeLogs(task, "out");
|
|
8799
8799
|
await this.writeLogs(task, "err");
|
|
8800
8800
|
if (task.mode === "skip" || task.mode === "todo")
|
|
8801
|
-
this.logger.log("<skipped/>");
|
|
8801
|
+
await this.logger.log("<skipped/>");
|
|
8802
8802
|
if (((_a = task.result) == null ? void 0 : _a.state) === "fail") {
|
|
8803
8803
|
const error = task.result.error;
|
|
8804
8804
|
await this.writeElement("failure", {
|
|
@@ -10188,7 +10188,7 @@ createLogUpdate(process$1.stdout);
|
|
|
10188
10188
|
|
|
10189
10189
|
createLogUpdate(process$1.stderr);
|
|
10190
10190
|
|
|
10191
|
-
var version = "0.25.
|
|
10191
|
+
var version = "0.25.3";
|
|
10192
10192
|
|
|
10193
10193
|
function fileFromParsedStack(stack) {
|
|
10194
10194
|
var _a, _b;
|
|
@@ -10904,6 +10904,7 @@ class Vitest {
|
|
|
10904
10904
|
const { include, exclude, includeSource } = this.config;
|
|
10905
10905
|
const globOptions = {
|
|
10906
10906
|
absolute: true,
|
|
10907
|
+
dot: true,
|
|
10907
10908
|
cwd: this.config.dir || this.config.root,
|
|
10908
10909
|
ignore: exclude
|
|
10909
10910
|
};
|
|
@@ -10965,7 +10966,7 @@ const EnvReplacerPlugin = () => {
|
|
|
10965
10966
|
return {
|
|
10966
10967
|
name: "vitest:env-replacer",
|
|
10967
10968
|
enforce: "pre",
|
|
10968
|
-
transform(code) {
|
|
10969
|
+
transform(code, id) {
|
|
10969
10970
|
if (!/\bimport\.meta\.env\b/g.test(code))
|
|
10970
10971
|
return null;
|
|
10971
10972
|
let s = null;
|
|
@@ -10979,7 +10980,7 @@ const EnvReplacerPlugin = () => {
|
|
|
10979
10980
|
if (s) {
|
|
10980
10981
|
return {
|
|
10981
10982
|
code: s.toString(),
|
|
10982
|
-
map: s.generateMap({ hires: true })
|
|
10983
|
+
map: s.generateMap({ hires: true, source: id })
|
|
10983
10984
|
};
|
|
10984
10985
|
}
|
|
10985
10986
|
}
|
|
@@ -11357,7 +11358,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
|
|
|
11357
11358
|
try {
|
|
11358
11359
|
await ctx.setServer(options, server);
|
|
11359
11360
|
if (options.api && options.watch)
|
|
11360
|
-
(await import('./chunk-api-setup.
|
|
11361
|
+
(await import('./chunk-api-setup.c9f38753.js')).setup(ctx);
|
|
11361
11362
|
} catch (err) {
|
|
11362
11363
|
ctx.logger.printError(err, true);
|
|
11363
11364
|
process.exit(1);
|
|
@@ -8,55 +8,39 @@ import assert from 'assert';
|
|
|
8
8
|
import { format, inspect } from 'util';
|
|
9
9
|
|
|
10
10
|
const TRAILING_SLASH_RE = /\/$|\/\?/;
|
|
11
|
-
function hasTrailingSlash(input = "",
|
|
12
|
-
if (!
|
|
11
|
+
function hasTrailingSlash(input = "", queryParameters = false) {
|
|
12
|
+
if (!queryParameters) {
|
|
13
13
|
return input.endsWith("/");
|
|
14
14
|
}
|
|
15
15
|
return TRAILING_SLASH_RE.test(input);
|
|
16
16
|
}
|
|
17
|
-
function withTrailingSlash(input = "",
|
|
18
|
-
if (!
|
|
17
|
+
function withTrailingSlash(input = "", queryParameters = false) {
|
|
18
|
+
if (!queryParameters) {
|
|
19
19
|
return input.endsWith("/") ? input : input + "/";
|
|
20
20
|
}
|
|
21
21
|
if (hasTrailingSlash(input, true)) {
|
|
22
22
|
return input || "/";
|
|
23
23
|
}
|
|
24
24
|
const [s0, ...s] = input.split("?");
|
|
25
|
-
return s0 + "/" + (s.length ? `?${s.join("?")}` : "");
|
|
25
|
+
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "");
|
|
26
26
|
}
|
|
27
27
|
function hasLeadingSlash(input = "") {
|
|
28
28
|
return input.startsWith("/");
|
|
29
29
|
}
|
|
30
30
|
function withoutLeadingSlash(input = "") {
|
|
31
|
-
return (hasLeadingSlash(input) ? input.
|
|
31
|
+
return (hasLeadingSlash(input) ? input.slice(1) : input) || "/";
|
|
32
32
|
}
|
|
33
33
|
function isNonEmptyURL(url) {
|
|
34
34
|
return url && url !== "/";
|
|
35
35
|
}
|
|
36
36
|
function joinURL(base, ...input) {
|
|
37
37
|
let url = base || "";
|
|
38
|
-
for (const
|
|
39
|
-
url = url ? withTrailingSlash(url) + withoutLeadingSlash(
|
|
38
|
+
for (const index of input.filter((url2) => isNonEmptyURL(url2))) {
|
|
39
|
+
url = url ? withTrailingSlash(url) + withoutLeadingSlash(index) : index;
|
|
40
40
|
}
|
|
41
41
|
return url;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function normalizeWindowsPath$1(input = "") {
|
|
45
|
-
if (!input || !input.includes("\\")) {
|
|
46
|
-
return input;
|
|
47
|
-
}
|
|
48
|
-
return input.replace(/\\/g, "/");
|
|
49
|
-
}
|
|
50
|
-
const _IS_ABSOLUTE_RE$1 = /^[\\/](?![\\/])|^[\\/]{2}(?!\.)|^[a-zA-Z]:[\\/]/;
|
|
51
|
-
const isAbsolute$1 = function(p) {
|
|
52
|
-
return _IS_ABSOLUTE_RE$1.test(p);
|
|
53
|
-
};
|
|
54
|
-
const _EXTNAME_RE = /.(\.[^/.]+)$/;
|
|
55
|
-
const extname = function(p) {
|
|
56
|
-
const match = _EXTNAME_RE.exec(normalizeWindowsPath$1(p));
|
|
57
|
-
return match && match[1] || "";
|
|
58
|
-
};
|
|
59
|
-
|
|
60
44
|
function normalizeWindowsPath(input = "") {
|
|
61
45
|
if (!input || !input.includes("\\")) {
|
|
62
46
|
return input;
|
|
@@ -64,9 +48,9 @@ function normalizeWindowsPath(input = "") {
|
|
|
64
48
|
return input.replace(/\\/g, "/");
|
|
65
49
|
}
|
|
66
50
|
|
|
67
|
-
const _UNC_REGEX = /^[
|
|
68
|
-
const _IS_ABSOLUTE_RE = /^[
|
|
69
|
-
const _DRIVE_LETTER_RE = /^[
|
|
51
|
+
const _UNC_REGEX = /^[/\\]{2}/;
|
|
52
|
+
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
53
|
+
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
70
54
|
const normalize = function(path) {
|
|
71
55
|
if (path.length === 0) {
|
|
72
56
|
return ".";
|
|
@@ -96,18 +80,17 @@ const normalize = function(path) {
|
|
|
96
80
|
}
|
|
97
81
|
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
98
82
|
};
|
|
99
|
-
const join = function(...
|
|
100
|
-
if (
|
|
83
|
+
const join = function(...arguments_) {
|
|
84
|
+
if (arguments_.length === 0) {
|
|
101
85
|
return ".";
|
|
102
86
|
}
|
|
103
87
|
let joined;
|
|
104
|
-
for (
|
|
105
|
-
|
|
106
|
-
if (arg && arg.length > 0) {
|
|
88
|
+
for (const argument of arguments_) {
|
|
89
|
+
if (argument && argument.length > 0) {
|
|
107
90
|
if (joined === void 0) {
|
|
108
|
-
joined =
|
|
91
|
+
joined = argument;
|
|
109
92
|
} else {
|
|
110
|
-
joined += `/${
|
|
93
|
+
joined += `/${argument}`;
|
|
111
94
|
}
|
|
112
95
|
}
|
|
113
96
|
}
|
|
@@ -116,12 +99,12 @@ const join = function(...args) {
|
|
|
116
99
|
}
|
|
117
100
|
return normalize(joined.replace(/\/\/+/g, "/"));
|
|
118
101
|
};
|
|
119
|
-
const resolve = function(...
|
|
120
|
-
|
|
102
|
+
const resolve = function(...arguments_) {
|
|
103
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
121
104
|
let resolvedPath = "";
|
|
122
105
|
let resolvedAbsolute = false;
|
|
123
|
-
for (let
|
|
124
|
-
const path =
|
|
106
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
107
|
+
const path = index >= 0 ? arguments_[index] : process.cwd().replace(/\\/g, "/");
|
|
125
108
|
if (!path || path.length === 0) {
|
|
126
109
|
continue;
|
|
127
110
|
}
|
|
@@ -140,16 +123,16 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
140
123
|
let lastSlash = -1;
|
|
141
124
|
let dots = 0;
|
|
142
125
|
let char = null;
|
|
143
|
-
for (let
|
|
144
|
-
if (
|
|
145
|
-
char = path[
|
|
126
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
127
|
+
if (index < path.length) {
|
|
128
|
+
char = path[index];
|
|
146
129
|
} else if (char === "/") {
|
|
147
130
|
break;
|
|
148
131
|
} else {
|
|
149
132
|
char = "/";
|
|
150
133
|
}
|
|
151
134
|
if (char === "/") {
|
|
152
|
-
if (lastSlash ===
|
|
135
|
+
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
153
136
|
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
154
137
|
if (res.length > 2) {
|
|
155
138
|
const lastSlashIndex = res.lastIndexOf("/");
|
|
@@ -160,13 +143,13 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
160
143
|
res = res.slice(0, lastSlashIndex);
|
|
161
144
|
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
162
145
|
}
|
|
163
|
-
lastSlash =
|
|
146
|
+
lastSlash = index;
|
|
164
147
|
dots = 0;
|
|
165
148
|
continue;
|
|
166
|
-
} else if (res.length
|
|
149
|
+
} else if (res.length > 0) {
|
|
167
150
|
res = "";
|
|
168
151
|
lastSegmentLength = 0;
|
|
169
|
-
lastSlash =
|
|
152
|
+
lastSlash = index;
|
|
170
153
|
dots = 0;
|
|
171
154
|
continue;
|
|
172
155
|
}
|
|
@@ -177,13 +160,13 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
177
160
|
}
|
|
178
161
|
} else {
|
|
179
162
|
if (res.length > 0) {
|
|
180
|
-
res += `/${path.slice(lastSlash + 1,
|
|
163
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
181
164
|
} else {
|
|
182
|
-
res = path.slice(lastSlash + 1,
|
|
165
|
+
res = path.slice(lastSlash + 1, index);
|
|
183
166
|
}
|
|
184
|
-
lastSegmentLength =
|
|
167
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
185
168
|
}
|
|
186
|
-
lastSlash =
|
|
169
|
+
lastSlash = index;
|
|
187
170
|
dots = 0;
|
|
188
171
|
} else if (char === "." && dots !== -1) {
|
|
189
172
|
++dots;
|
|
@@ -196,6 +179,11 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
196
179
|
const isAbsolute = function(p) {
|
|
197
180
|
return _IS_ABSOLUTE_RE.test(p);
|
|
198
181
|
};
|
|
182
|
+
const _EXTNAME_RE = /.(\.[^./]+)$/;
|
|
183
|
+
const extname = function(p) {
|
|
184
|
+
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
185
|
+
return match && match[1] || "";
|
|
186
|
+
};
|
|
199
187
|
|
|
200
188
|
const defaultFindOptions = {
|
|
201
189
|
startingFrom: ".",
|
|
@@ -208,7 +196,6 @@ const defaultFindOptions = {
|
|
|
208
196
|
}
|
|
209
197
|
} catch {
|
|
210
198
|
}
|
|
211
|
-
return null;
|
|
212
199
|
}
|
|
213
200
|
};
|
|
214
201
|
async function findFile(filename, _options = {}) {
|
|
@@ -224,15 +211,15 @@ async function findFile(filename, _options = {}) {
|
|
|
224
211
|
root = 0;
|
|
225
212
|
}
|
|
226
213
|
if (!options.reverse) {
|
|
227
|
-
for (let
|
|
228
|
-
const filePath = join(...segments.slice(0,
|
|
214
|
+
for (let index = segments.length; index > root; index--) {
|
|
215
|
+
const filePath = join(...segments.slice(0, index), filename);
|
|
229
216
|
if (await options.test(filePath)) {
|
|
230
217
|
return filePath;
|
|
231
218
|
}
|
|
232
219
|
}
|
|
233
220
|
} else {
|
|
234
|
-
for (let
|
|
235
|
-
const filePath = join(...segments.slice(0,
|
|
221
|
+
for (let index = root + 1; index <= segments.length; index++) {
|
|
222
|
+
const filePath = join(...segments.slice(0, index), filename);
|
|
236
223
|
if (await options.test(filePath)) {
|
|
237
224
|
return filePath;
|
|
238
225
|
}
|
|
@@ -243,35 +230,43 @@ async function findFile(filename, _options = {}) {
|
|
|
243
230
|
function findNearestFile(filename, _options = {}) {
|
|
244
231
|
return findFile(filename, _options);
|
|
245
232
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
|
|
233
|
+
const FileCache = /* @__PURE__ */ new Map();
|
|
234
|
+
async function readPackageJSON(id, options = {}) {
|
|
235
|
+
const resolvedPath = await resolvePackageJSON(id, options);
|
|
236
|
+
const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
|
|
237
|
+
if (options.cache && cache.has(resolvedPath)) {
|
|
238
|
+
return cache.get(resolvedPath);
|
|
239
|
+
}
|
|
240
|
+
const blob = await promises.readFile(resolvedPath, "utf8");
|
|
241
|
+
const parsed = JSON.parse(blob);
|
|
242
|
+
cache.set(resolvedPath, parsed);
|
|
243
|
+
return parsed;
|
|
250
244
|
}
|
|
251
|
-
async function resolvePackageJSON(id = process.cwd(),
|
|
252
|
-
const resolvedPath = isAbsolute(id) ? id : await resolvePath(id,
|
|
253
|
-
return findNearestFile("package.json", { startingFrom: resolvedPath, ...
|
|
245
|
+
async function resolvePackageJSON(id = process.cwd(), options = {}) {
|
|
246
|
+
const resolvedPath = isAbsolute(id) ? id : await resolvePath(id, options);
|
|
247
|
+
return findNearestFile("package.json", { startingFrom: resolvedPath, ...options });
|
|
254
248
|
}
|
|
255
249
|
|
|
256
250
|
const BUILTIN_MODULES = new Set(builtinModules);
|
|
257
|
-
function normalizeSlash(
|
|
258
|
-
return
|
|
251
|
+
function normalizeSlash(string_) {
|
|
252
|
+
return string_.replace(/\\/g, "/");
|
|
259
253
|
}
|
|
260
|
-
function pcall(
|
|
254
|
+
function pcall(function_, ...arguments_) {
|
|
261
255
|
try {
|
|
262
|
-
return Promise.resolve(
|
|
263
|
-
} catch (
|
|
264
|
-
return perr(
|
|
256
|
+
return Promise.resolve(function_(...arguments_)).catch((error) => perr(error));
|
|
257
|
+
} catch (error) {
|
|
258
|
+
return perr(error);
|
|
265
259
|
}
|
|
266
260
|
}
|
|
267
|
-
function perr(
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
Error.captureStackTrace(
|
|
271
|
-
return Promise.reject(
|
|
261
|
+
function perr(_error) {
|
|
262
|
+
const error = new Error(_error);
|
|
263
|
+
error.code = _error.code;
|
|
264
|
+
Error.captureStackTrace(error, pcall);
|
|
265
|
+
return Promise.reject(error);
|
|
272
266
|
}
|
|
273
267
|
|
|
274
268
|
const reader = { read };
|
|
269
|
+
const packageJsonReader = reader;
|
|
275
270
|
function read(jsonPath) {
|
|
276
271
|
return find(path.dirname(jsonPath));
|
|
277
272
|
}
|
|
@@ -591,7 +586,7 @@ function getPackageConfig(path2, specifier, base) {
|
|
|
591
586
|
if (existing !== void 0) {
|
|
592
587
|
return existing;
|
|
593
588
|
}
|
|
594
|
-
const source =
|
|
589
|
+
const source = packageJsonReader.read(path2).string;
|
|
595
590
|
if (source === void 0) {
|
|
596
591
|
const packageConfig2 = {
|
|
597
592
|
pjsonPath: path2,
|
|
@@ -1212,7 +1207,7 @@ function isNodeBuiltin(id = "") {
|
|
|
1212
1207
|
const ProtocolRegex = /^(?<proto>.{2,}?):.+$/;
|
|
1213
1208
|
function getProtocol(id) {
|
|
1214
1209
|
const proto = id.match(ProtocolRegex);
|
|
1215
|
-
return proto ? proto.groups.proto :
|
|
1210
|
+
return proto ? proto.groups.proto : void 0;
|
|
1216
1211
|
}
|
|
1217
1212
|
|
|
1218
1213
|
const DEFAULT_CONDITIONS_SET = /* @__PURE__ */ new Set(["node", "import"]);
|
|
@@ -1222,35 +1217,36 @@ const NOT_FOUND_ERRORS = /* @__PURE__ */ new Set(["ERR_MODULE_NOT_FOUND", "ERR_U
|
|
|
1222
1217
|
function _tryModuleResolve(id, url, conditions) {
|
|
1223
1218
|
try {
|
|
1224
1219
|
return moduleResolve(id, url, conditions);
|
|
1225
|
-
} catch (
|
|
1226
|
-
if (!NOT_FOUND_ERRORS.has(
|
|
1227
|
-
throw
|
|
1220
|
+
} catch (error) {
|
|
1221
|
+
if (!NOT_FOUND_ERRORS.has(error.code)) {
|
|
1222
|
+
throw error;
|
|
1228
1223
|
}
|
|
1229
|
-
return null;
|
|
1230
1224
|
}
|
|
1231
1225
|
}
|
|
1232
|
-
function _resolve(id,
|
|
1226
|
+
function _resolve(id, options = {}) {
|
|
1233
1227
|
if (/(node|data|http|https):/.test(id)) {
|
|
1234
1228
|
return id;
|
|
1235
1229
|
}
|
|
1236
1230
|
if (BUILTIN_MODULES.has(id)) {
|
|
1237
1231
|
return "node:" + id;
|
|
1238
1232
|
}
|
|
1239
|
-
if (isAbsolute
|
|
1233
|
+
if (isAbsolute(id) && existsSync(id)) {
|
|
1240
1234
|
const realPath2 = realpathSync(fileURLToPath(id));
|
|
1241
1235
|
return pathToFileURL(realPath2).toString();
|
|
1242
1236
|
}
|
|
1243
|
-
const conditionsSet =
|
|
1244
|
-
const _urls = (Array.isArray(
|
|
1245
|
-
if (
|
|
1237
|
+
const conditionsSet = options.conditions ? new Set(options.conditions) : DEFAULT_CONDITIONS_SET;
|
|
1238
|
+
const _urls = (Array.isArray(options.url) ? options.url : [options.url]).filter(Boolean).map((u) => new URL(normalizeid(u.toString())));
|
|
1239
|
+
if (_urls.length === 0) {
|
|
1246
1240
|
_urls.push(DEFAULT_URL);
|
|
1247
1241
|
}
|
|
1248
1242
|
const urls = [..._urls];
|
|
1249
1243
|
for (const url of _urls) {
|
|
1250
1244
|
if (url.protocol === "file:") {
|
|
1251
|
-
urls.push(
|
|
1252
|
-
|
|
1253
|
-
|
|
1245
|
+
urls.push(
|
|
1246
|
+
new URL("./", url),
|
|
1247
|
+
new URL(joinURL(url.pathname, "_index.js"), url),
|
|
1248
|
+
new URL("node_modules", url)
|
|
1249
|
+
);
|
|
1254
1250
|
}
|
|
1255
1251
|
}
|
|
1256
1252
|
let resolved;
|
|
@@ -1260,8 +1256,8 @@ function _resolve(id, opts = {}) {
|
|
|
1260
1256
|
break;
|
|
1261
1257
|
}
|
|
1262
1258
|
for (const prefix of ["", "/index"]) {
|
|
1263
|
-
for (const
|
|
1264
|
-
resolved = _tryModuleResolve(id + prefix +
|
|
1259
|
+
for (const extension of options.extensions || DEFAULT_EXTENSIONS) {
|
|
1260
|
+
resolved = _tryModuleResolve(id + prefix + extension, url, conditionsSet);
|
|
1265
1261
|
if (resolved) {
|
|
1266
1262
|
break;
|
|
1267
1263
|
}
|
|
@@ -1272,24 +1268,24 @@ function _resolve(id, opts = {}) {
|
|
|
1272
1268
|
}
|
|
1273
1269
|
}
|
|
1274
1270
|
if (!resolved) {
|
|
1275
|
-
const
|
|
1276
|
-
|
|
1277
|
-
throw
|
|
1271
|
+
const error = new Error(`Cannot find module ${id} imported from ${urls.join(", ")}`);
|
|
1272
|
+
error.code = "ERR_MODULE_NOT_FOUND";
|
|
1273
|
+
throw error;
|
|
1278
1274
|
}
|
|
1279
1275
|
const realPath = realpathSync(fileURLToPath(resolved));
|
|
1280
1276
|
return pathToFileURL(realPath).toString();
|
|
1281
1277
|
}
|
|
1282
|
-
function resolveSync(id,
|
|
1283
|
-
return _resolve(id,
|
|
1278
|
+
function resolveSync(id, options) {
|
|
1279
|
+
return _resolve(id, options);
|
|
1284
1280
|
}
|
|
1285
|
-
function resolvePathSync(id,
|
|
1286
|
-
return fileURLToPath(resolveSync(id,
|
|
1281
|
+
function resolvePathSync(id, options) {
|
|
1282
|
+
return fileURLToPath(resolveSync(id, options));
|
|
1287
1283
|
}
|
|
1288
|
-
function resolvePath(id,
|
|
1289
|
-
return pcall(resolvePathSync, id,
|
|
1284
|
+
function resolvePath(id, options) {
|
|
1285
|
+
return pcall(resolvePathSync, id, options);
|
|
1290
1286
|
}
|
|
1291
1287
|
|
|
1292
|
-
const ESM_RE = /([\s;]|^)(import[\w
|
|
1288
|
+
const ESM_RE = /([\s;]|^)(import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m;
|
|
1293
1289
|
const BUILTIN_EXTENSIONS = /* @__PURE__ */ new Set([".mjs", ".cjs", ".node", ".wasm"]);
|
|
1294
1290
|
function hasESMSyntax(code) {
|
|
1295
1291
|
return ESM_RE.test(code);
|
|
@@ -1301,19 +1297,19 @@ function hasCJSSyntax(code) {
|
|
|
1301
1297
|
const validNodeImportDefaults = {
|
|
1302
1298
|
allowedProtocols: ["node", "file", "data"]
|
|
1303
1299
|
};
|
|
1304
|
-
async function isValidNodeImport(id,
|
|
1300
|
+
async function isValidNodeImport(id, _options = {}) {
|
|
1305
1301
|
if (isNodeBuiltin(id)) {
|
|
1306
1302
|
return true;
|
|
1307
1303
|
}
|
|
1308
|
-
const
|
|
1304
|
+
const options = { ...validNodeImportDefaults, ..._options };
|
|
1309
1305
|
const proto = getProtocol(id);
|
|
1310
|
-
if (proto && !
|
|
1306
|
+
if (proto && !options.allowedProtocols.includes(proto)) {
|
|
1311
1307
|
return false;
|
|
1312
1308
|
}
|
|
1313
1309
|
if (proto === "data") {
|
|
1314
1310
|
return true;
|
|
1315
1311
|
}
|
|
1316
|
-
const resolvedPath = await resolvePath(id,
|
|
1312
|
+
const resolvedPath = await resolvePath(id, options);
|
|
1317
1313
|
const extension = extname(resolvedPath);
|
|
1318
1314
|
if (BUILTIN_EXTENSIONS.has(extension)) {
|
|
1319
1315
|
return true;
|
|
@@ -1321,14 +1317,16 @@ async function isValidNodeImport(id, _opts = {}) {
|
|
|
1321
1317
|
if (extension !== ".js") {
|
|
1322
1318
|
return false;
|
|
1323
1319
|
}
|
|
1324
|
-
const
|
|
1325
|
-
|
|
1320
|
+
const package_ = await readPackageJSON(resolvedPath).catch(() => {
|
|
1321
|
+
});
|
|
1322
|
+
if (package_?.type === "module") {
|
|
1326
1323
|
return true;
|
|
1327
1324
|
}
|
|
1328
|
-
if (
|
|
1325
|
+
if (/\.(\w+-)?esm?(-\w+)?\.js$|\/(esm?)\//.test(resolvedPath)) {
|
|
1329
1326
|
return false;
|
|
1330
1327
|
}
|
|
1331
|
-
const code =
|
|
1328
|
+
const code = options.code || await promises.readFile(resolvedPath, "utf8").catch(() => {
|
|
1329
|
+
}) || "";
|
|
1332
1330
|
return hasCJSSyntax(code) || !hasESMSyntax(code);
|
|
1333
1331
|
}
|
|
1334
1332
|
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as picocolors, n as normalize } from './chunk-utils-env.03f840f2.js';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.
|
|
3
|
+
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.c57d0ad1.js';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'url';
|
|
6
6
|
import 'path';
|
|
@@ -16,10 +16,10 @@ import 'os';
|
|
|
16
16
|
import 'util';
|
|
17
17
|
import 'stream';
|
|
18
18
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
19
|
-
import './chunk-vite-node-client.
|
|
19
|
+
import './chunk-vite-node-client.58cb6bfa.js';
|
|
20
20
|
import 'module';
|
|
21
21
|
import 'vm';
|
|
22
|
-
import './chunk-vite-node-utils.
|
|
22
|
+
import './chunk-vite-node-utils.f6d73fbe.js';
|
|
23
23
|
import 'acorn';
|
|
24
24
|
import 'assert';
|
|
25
25
|
import 'debug';
|
|
@@ -687,9 +687,12 @@ async function typecheck(cliFilters = [], options = {}) {
|
|
|
687
687
|
await start("typecheck", cliFilters, options);
|
|
688
688
|
}
|
|
689
689
|
function normalizeOptions(argv) {
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
690
|
+
if (argv.root)
|
|
691
|
+
argv.root = normalize(argv.root);
|
|
692
|
+
if (argv.config)
|
|
693
|
+
argv.config = normalize(argv.config);
|
|
694
|
+
if (argv.dir)
|
|
695
|
+
argv.dir = normalize(argv.dir);
|
|
693
696
|
return argv;
|
|
694
697
|
}
|
|
695
698
|
async function start(mode, cliFilters, options) {
|
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UserConfig as UserConfig$2, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv } from 'vite';
|
|
3
|
-
import { U as UserConfig$1, ao as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './types-
|
|
3
|
+
import { U as UserConfig$1, ao as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './types-de0e0997.js';
|
|
4
4
|
import 'tinybench';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'worker_threads';
|
package/dist/entry.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
2
|
import { g as getWorkerState, a as resetModules } from './chunk-typecheck-constants.4891f22f.js';
|
|
3
|
-
import { v as vi } from './chunk-runtime-test-state.
|
|
3
|
+
import { v as vi } from './chunk-runtime-test-state.de4d6ff8.js';
|
|
4
4
|
import { a as envs } from './chunk-env-node.67948209.js';
|
|
5
|
-
import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-setup.
|
|
5
|
+
import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-setup.667a5719.js';
|
|
6
6
|
import 'path';
|
|
7
7
|
import './chunk-utils-env.03f840f2.js';
|
|
8
8
|
import 'tty';
|
|
9
9
|
import 'url';
|
|
10
10
|
import 'local-pkg';
|
|
11
|
-
import './chunk-runtime-chain.
|
|
11
|
+
import './chunk-runtime-chain.f993b1dc.js';
|
|
12
12
|
import 'util';
|
|
13
13
|
import 'chai';
|
|
14
14
|
import './vendor-_commonjsHelpers.addc3445.js';
|
package/dist/environments.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpyImpl } from 'tinyspy';
|
|
2
|
-
import { w as SuiteAPI, v as TestAPI, aw as BenchmarkAPI, y as SuiteHooks, H as HookListener, L as TestContext, p as Suite, x as HookCleanupCallback, O as OnTestFailedHandler, q as Test } from './types-
|
|
2
|
+
import { w as SuiteAPI, v as TestAPI, aw as BenchmarkAPI, y as SuiteHooks, H as HookListener, L as TestContext, p as Suite, x as HookCleanupCallback, O as OnTestFailedHandler, q as Test } from './types-de0e0997.js';
|
|
3
3
|
|
|
4
4
|
declare type Not<T extends boolean> = T extends true ? false : true;
|
|
5
5
|
declare type And<Types extends boolean[]> = Types[number] extends true ? true : false;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as spyOn, f as fn, M as MaybeMockedDeep, a as MaybeMocked, b as MaybePartiallyMocked, c as MaybePartiallyMockedDeep, E as EnhancedSpy } from './index-
|
|
2
|
-
export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-
|
|
3
|
-
import { D as DoneCallback, F as FakeTimerInstallOpts, R as RuntimeConfig, a as File, T as TaskResultPack, b as ResolvedConfig, M as ModuleGraphData, c as Reporter } from './types-
|
|
4
|
-
export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-
|
|
1
|
+
import { s as spyOn, f as fn, M as MaybeMockedDeep, a as MaybeMocked, b as MaybePartiallyMocked, c as MaybePartiallyMockedDeep, E as EnhancedSpy } from './index-9f5bc072.js';
|
|
2
|
+
export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-9f5bc072.js';
|
|
3
|
+
import { D as DoneCallback, F as FakeTimerInstallOpts, R as RuntimeConfig, a as File, T as TaskResultPack, b as ResolvedConfig, M as ModuleGraphData, c as Reporter } from './types-de0e0997.js';
|
|
4
|
+
export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-de0e0997.js';
|
|
5
5
|
import { TransformResult } from 'vite';
|
|
6
6
|
import * as chai from 'chai';
|
|
7
7
|
export { chai };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { b as bench, c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.
|
|
2
|
-
import { e as dist } from './chunk-runtime-test-state.
|
|
3
|
-
export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, k as getRunningMode, h as isFirstRun, l as isWatchMode, o as onTestFailed, g as runOnce, v as vi, j as vitest, w as withCallback } from './chunk-runtime-test-state.
|
|
1
|
+
export { b as bench, c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.f993b1dc.js';
|
|
2
|
+
import { e as dist } from './chunk-runtime-test-state.de4d6ff8.js';
|
|
3
|
+
export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, k as getRunningMode, h as isFirstRun, l as isWatchMode, o as onTestFailed, g as runOnce, v as vi, j as vitest, w as withCallback } from './chunk-runtime-test-state.de4d6ff8.js';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
package/dist/loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pathToFileURL } from 'url';
|
|
2
2
|
import { readFile } from 'fs/promises';
|
|
3
|
-
import { i as isNodeBuiltin, d as normalizeModuleId, h as hasCJSSyntax } from './chunk-vite-node-utils.
|
|
3
|
+
import { i as isNodeBuiltin, d as normalizeModuleId, h as hasCJSSyntax } from './chunk-vite-node-utils.f6d73fbe.js';
|
|
4
4
|
import { g as getWorkerState } from './chunk-typecheck-constants.4891f22f.js';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import './chunk-utils-env.03f840f2.js';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as VitestRunMode, U as UserConfig, N as Vitest, ax as ModuleCacheMap, ay as ViteNodeRunnerOptions, az as MockMap, aA as ViteNodeRunner, aB as TestSequencer } from './types-
|
|
2
|
-
export { aB as TestSequencer, aD as TestSequencerConstructor, N as Vitest, aC as startVitest } from './types-
|
|
1
|
+
import { j as VitestRunMode, U as UserConfig, N as Vitest, ax as ModuleCacheMap, ay as ViteNodeRunnerOptions, az as MockMap, aA as ViteNodeRunner, aB as TestSequencer } from './types-de0e0997.js';
|
|
2
|
+
export { aB as TestSequencer, aD as TestSequencerConstructor, N as Vitest, aC as startVitest } from './types-de0e0997.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, Plugin } from 'vite';
|
|
4
4
|
import 'tinybench';
|
|
5
5
|
import 'fs';
|
package/dist/node.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.
|
|
2
|
-
export { V as VitestRunner } from './chunk-runtime-mocker.
|
|
1
|
+
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.c57d0ad1.js';
|
|
2
|
+
export { V as VitestRunner } from './chunk-runtime-mocker.c4d85347.js';
|
|
3
3
|
import './chunk-utils-env.03f840f2.js';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'url';
|
|
@@ -17,10 +17,10 @@ import 'util';
|
|
|
17
17
|
import 'stream';
|
|
18
18
|
import 'events';
|
|
19
19
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
20
|
-
import './chunk-vite-node-client.
|
|
20
|
+
import './chunk-vite-node-client.58cb6bfa.js';
|
|
21
21
|
import 'module';
|
|
22
22
|
import 'vm';
|
|
23
|
-
import './chunk-vite-node-utils.
|
|
23
|
+
import './chunk-vite-node-utils.f6d73fbe.js';
|
|
24
24
|
import 'acorn';
|
|
25
25
|
import 'assert';
|
|
26
26
|
import 'debug';
|
package/dist/suite.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'util';
|
|
2
2
|
import './chunk-typecheck-constants.4891f22f.js';
|
|
3
|
-
export { b as bench, f as clearCollectorContext, q as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.
|
|
3
|
+
export { b as bench, f as clearCollectorContext, q as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.f993b1dc.js';
|
|
4
4
|
import 'path';
|
|
5
5
|
import './chunk-utils-env.03f840f2.js';
|
|
6
6
|
import 'tty';
|
|
@@ -1277,6 +1277,7 @@ interface TestEachFunction {
|
|
|
1277
1277
|
<T extends any[] | [any]>(cases: ReadonlyArray<T>): (name: string, fn: (...args: T) => Awaitable<void>, options?: number | TestOptions) => void;
|
|
1278
1278
|
<T extends ReadonlyArray<any>>(cases: ReadonlyArray<T>): (name: string, fn: (...args: ExtractEachCallbackArgs<T>) => Awaitable<void>, options?: number | TestOptions) => void;
|
|
1279
1279
|
<T>(cases: ReadonlyArray<T>): (name: string, fn: (...args: T[]) => Awaitable<void>, options?: number | TestOptions) => void;
|
|
1280
|
+
(...args: [TemplateStringsArray, ...any]): (name: string, fn: (...args: any[]) => Awaitable<void>, options?: number | TestOptions) => void;
|
|
1280
1281
|
}
|
|
1281
1282
|
declare type ChainableTestAPI<ExtraContext = {}> = ChainableFunction<'concurrent' | 'only' | 'skip' | 'todo' | 'fails', [
|
|
1282
1283
|
name: string,
|
package/dist/worker.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { b as resolve, e as distDir } from './chunk-utils-env.03f840f2.js';
|
|
2
|
-
import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-client.
|
|
2
|
+
import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-client.58cb6bfa.js';
|
|
3
3
|
import { workerId } from 'tinypool';
|
|
4
4
|
import { g as getWorkerState } from './chunk-typecheck-constants.4891f22f.js';
|
|
5
|
-
import { e as executeInViteNode } from './chunk-runtime-mocker.
|
|
5
|
+
import { e as executeInViteNode } from './chunk-runtime-mocker.c4d85347.js';
|
|
6
6
|
import { r as rpc } from './chunk-runtime-rpc.1e7530d3.js';
|
|
7
7
|
import { p as processError } from './chunk-runtime-error.6287172c.js';
|
|
8
8
|
import 'tty';
|
|
@@ -10,7 +10,7 @@ import 'url';
|
|
|
10
10
|
import 'path';
|
|
11
11
|
import 'module';
|
|
12
12
|
import 'vm';
|
|
13
|
-
import './chunk-vite-node-utils.
|
|
13
|
+
import './chunk-vite-node-utils.f6d73fbe.js';
|
|
14
14
|
import 'fs';
|
|
15
15
|
import 'acorn';
|
|
16
16
|
import 'assert';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.25.
|
|
4
|
+
"version": "0.25.3",
|
|
5
5
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"@types/natural-compare": "^1.4.1",
|
|
126
126
|
"@types/prompts": "^2.4.1",
|
|
127
127
|
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
128
|
-
"@vitest/ui": "0.25.
|
|
128
|
+
"@vitest/ui": "0.25.3",
|
|
129
129
|
"birpc": "^0.2.3",
|
|
130
130
|
"cac": "^6.7.14",
|
|
131
131
|
"chai-subset": "^1.6.0",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"log-update": "^5.0.1",
|
|
144
144
|
"magic-string": "^0.26.7",
|
|
145
145
|
"micromatch": "^4.0.5",
|
|
146
|
-
"mlly": "^0.
|
|
146
|
+
"mlly": "^1.0.0",
|
|
147
147
|
"natural-compare": "^1.4.0",
|
|
148
148
|
"p-limit": "^4.0.0",
|
|
149
149
|
"pathe": "^0.2.0",
|
|
@@ -154,11 +154,11 @@
|
|
|
154
154
|
"rollup": "^2.79.1",
|
|
155
155
|
"strip-ansi": "^7.0.1",
|
|
156
156
|
"typescript": "^4.8.4",
|
|
157
|
-
"vite-node": "0.25.
|
|
157
|
+
"vite-node": "0.25.3",
|
|
158
158
|
"ws": "^8.11.0"
|
|
159
159
|
},
|
|
160
160
|
"scripts": {
|
|
161
161
|
"build": "rimraf dist && rollup -c",
|
|
162
|
-
"dev": "
|
|
162
|
+
"dev": "NODE_OPTIONS=\"--max-old-space-size=8192\" rollup -c --watch -m inline"
|
|
163
163
|
}
|
|
164
164
|
}
|