vitest 0.32.2 → 0.32.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 +33 -4
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +22 -5
- package/dist/child.js +3 -3
- package/dist/{chunk-api-setup.05e3917b.js → chunk-api-setup.8f785c4a.js} +18 -11
- package/dist/{chunk-install-pkg.62047ee6.js → chunk-install-pkg.0716919d.js} +69 -55
- package/dist/{chunk-integrations-globals.a56dee90.js → chunk-integrations-globals.0093e2ed.js} +5 -5
- package/dist/{chunk-node-git.4c43bd73.js → chunk-node-git.c410fed8.js} +3 -2
- package/dist/cli-wrapper.js +2 -2
- package/dist/cli.js +8 -8
- package/dist/config.d.ts +1 -1
- package/dist/coverage.d.ts +1 -1
- package/dist/entry.js +9 -9
- package/dist/environments.d.ts +1 -1
- package/dist/environments.js +1 -1
- package/dist/index.d.ts +60 -40
- package/dist/index.js +6 -6
- package/dist/loader.js +140 -4
- package/dist/node.d.ts +3 -3
- package/dist/node.js +9 -9
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +24 -19
- package/dist/suite.d.ts +1 -0
- package/dist/{types-2b1c412e.d.ts → types-198fd1d9.d.ts} +302 -77
- package/dist/vendor-_commonjsHelpers.7d1333e8.js +7 -0
- package/dist/{vendor-cli-api.f9adf98c.js → vendor-cli-api.ff679aa2.js} +281 -229
- package/dist/{vendor-coverage.de2180ed.js → vendor-coverage.2e41927a.js} +1 -1
- package/dist/{vendor-execute.001ae440.js → vendor-execute.3576af13.js} +14 -16
- package/dist/{vendor-index.c1e09929.js → vendor-index.1f85e5f1.js} +52 -39
- package/dist/{vendor-index.fad2598b.js → vendor-index.23ac4e13.js} +1 -1
- package/dist/{vendor-index.0f133dbe.js → vendor-index.2af39fbb.js} +5 -3
- package/dist/{vendor-index.fc98d30f.js → vendor-index.98139333.js} +4 -22
- package/dist/{vendor-index.87ab04c3.js → vendor-index.cc463d9e.js} +2 -1
- package/dist/{vendor-rpc.4d3d7a54.js → vendor-rpc.ad5b08c7.js} +10 -10
- package/dist/{vendor-run-once.69ce7172.js → vendor-run-once.1fa85ba7.js} +2 -2
- package/dist/vendor-vi.dd6706cb.js +3421 -0
- package/dist/worker.js +3 -3
- package/package.json +21 -22
- package/dist/vendor-_commonjsHelpers.76cdd49e.js +0 -3
- package/dist/vendor-setup.common.f1cf2231.js +0 -20
- package/dist/vendor-vi.74cf3ef7.js +0 -3354
- /package/dist/{vendor-index.75f2b63d.js → vendor-environments.75f2b63d.js} +0 -0
package/dist/runners.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
|
|
2
|
-
import { g as getSnapshotClient, c as createExpect, v as vi, a as getBenchOptions, b as getBenchFn } from './vendor-vi.
|
|
3
|
-
import './vendor-index.
|
|
4
|
-
import {
|
|
2
|
+
import { g as getSnapshotClient, c as createExpect, v as vi, a as getBenchOptions, b as getBenchFn } from './vendor-vi.dd6706cb.js';
|
|
3
|
+
import './vendor-index.23ac4e13.js';
|
|
4
|
+
import { a as rpc } from './vendor-rpc.ad5b08c7.js';
|
|
5
5
|
import { g as getFullName } from './vendor-tasks.f9d75aed.js';
|
|
6
6
|
import { g as getWorkerState } from './vendor-global.6795f91f.js';
|
|
7
7
|
import { getNames } from '@vitest/runner/utils';
|
|
@@ -9,7 +9,7 @@ import { performance } from 'node:perf_hooks';
|
|
|
9
9
|
import { updateTask } from '@vitest/runner';
|
|
10
10
|
import { createDefer, getSafeTimers } from '@vitest/utils';
|
|
11
11
|
import 'chai';
|
|
12
|
-
import './vendor-_commonjsHelpers.
|
|
12
|
+
import './vendor-_commonjsHelpers.7d1333e8.js';
|
|
13
13
|
import '@vitest/snapshot';
|
|
14
14
|
import '@vitest/utils/error';
|
|
15
15
|
import 'util';
|
|
@@ -20,10 +20,11 @@ import 'std-env';
|
|
|
20
20
|
class VitestTestRunner {
|
|
21
21
|
constructor(config) {
|
|
22
22
|
this.config = config;
|
|
23
|
-
this.snapshotClient = getSnapshotClient();
|
|
24
|
-
this.workerState = getWorkerState();
|
|
25
|
-
this.cancelRun = false;
|
|
26
23
|
}
|
|
24
|
+
snapshotClient = getSnapshotClient();
|
|
25
|
+
workerState = getWorkerState();
|
|
26
|
+
__vitest_executor;
|
|
27
|
+
cancelRun = false;
|
|
27
28
|
importFile(filepath, source) {
|
|
28
29
|
if (source === "setup")
|
|
29
30
|
this.workerState.moduleCache.delete(filepath);
|
|
@@ -126,7 +127,7 @@ function clearModuleMocks(config) {
|
|
|
126
127
|
|
|
127
128
|
async function importTinybench() {
|
|
128
129
|
if (!globalThis.EventTarget)
|
|
129
|
-
await import('./vendor-index.
|
|
130
|
+
await import('./vendor-index.98139333.js').then(function (n) { return n.i; });
|
|
130
131
|
return await import('tinybench');
|
|
131
132
|
}
|
|
132
133
|
function createBenchmarkResult(name) {
|
|
@@ -137,6 +138,7 @@ function createBenchmarkResult(name) {
|
|
|
137
138
|
samples: []
|
|
138
139
|
};
|
|
139
140
|
}
|
|
141
|
+
const benchmarkTasks = /* @__PURE__ */ new WeakMap();
|
|
140
142
|
async function runBenchmarkSuite(suite, runner) {
|
|
141
143
|
var _a;
|
|
142
144
|
const { Task, Bench } = await importTinybench();
|
|
@@ -174,32 +176,34 @@ async function runBenchmarkSuite(suite, runner) {
|
|
|
174
176
|
const id = idx.toString();
|
|
175
177
|
benchmarkMap[id] = benchmark;
|
|
176
178
|
const task = new Task(benchmarkInstance, id, benchmarkFn);
|
|
177
|
-
benchmark
|
|
179
|
+
benchmarkTasks.set(benchmark, task);
|
|
178
180
|
updateTask$1(benchmark);
|
|
179
181
|
});
|
|
180
182
|
benchmarkGroup.forEach((benchmark) => {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
const
|
|
183
|
+
const task = benchmarkTasks.get(benchmark);
|
|
184
|
+
task.addEventListener("complete", (e) => {
|
|
185
|
+
const task2 = e.task;
|
|
186
|
+
const _benchmark = benchmarkMap[task2.name || ""];
|
|
184
187
|
if (_benchmark) {
|
|
185
|
-
const taskRes =
|
|
188
|
+
const taskRes = task2.result;
|
|
186
189
|
const result = _benchmark.result.benchmark;
|
|
187
190
|
Object.assign(result, taskRes);
|
|
188
191
|
updateTask$1(_benchmark);
|
|
189
192
|
}
|
|
190
193
|
});
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
const _benchmark = benchmarkMap[
|
|
194
|
-
defer.reject(_benchmark ?
|
|
194
|
+
task.addEventListener("error", (e) => {
|
|
195
|
+
const task2 = e.task;
|
|
196
|
+
const _benchmark = benchmarkMap[task2.name || ""];
|
|
197
|
+
defer.reject(_benchmark ? task2.result.error : e);
|
|
195
198
|
});
|
|
196
199
|
});
|
|
197
200
|
const tasks = [];
|
|
198
201
|
for (const benchmark of benchmarkGroup) {
|
|
199
|
-
|
|
202
|
+
const task = benchmarkTasks.get(benchmark);
|
|
203
|
+
await task.warmup();
|
|
200
204
|
const { setTimeout } = getSafeTimers();
|
|
201
205
|
tasks.push(await new Promise((resolve) => setTimeout(async () => {
|
|
202
|
-
resolve(await
|
|
206
|
+
resolve(await task.run());
|
|
203
207
|
})));
|
|
204
208
|
}
|
|
205
209
|
suite.result.duration = performance.now() - start;
|
|
@@ -225,6 +229,7 @@ class NodeBenchmarkRunner {
|
|
|
225
229
|
constructor(config) {
|
|
226
230
|
this.config = config;
|
|
227
231
|
}
|
|
232
|
+
__vitest_executor;
|
|
228
233
|
importFile(filepath, source) {
|
|
229
234
|
if (source === "setup")
|
|
230
235
|
getWorkerState().moduleCache.delete(filepath);
|
package/dist/suite.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import * as _vitest_runner from '@vitest/runner';
|
|
|
5
5
|
import { File, Test as Test$1, Suite, TaskResultPack, Task, CancelReason, TaskCustom, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
6
6
|
import { ChainableFunction } from '@vitest/runner/utils';
|
|
7
7
|
import { ParsedStack, Awaitable as Awaitable$1, ErrorWithDiff, Arrayable as Arrayable$1 } from '@vitest/utils';
|
|
8
|
-
import {
|
|
8
|
+
import { TaskResult, Bench, Options } from 'tinybench';
|
|
9
9
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
10
10
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
11
11
|
import { ViteNodeServer } from 'vite-node/server';
|
|
@@ -14,91 +14,291 @@ import { RawSourceMap, FetchResult, ViteNodeResolveId, ModuleCacheMap } from 'vi
|
|
|
14
14
|
import { Stats } from 'node:fs';
|
|
15
15
|
import * as chai from 'chai';
|
|
16
16
|
|
|
17
|
+
declare const Kind: unique symbol;
|
|
18
|
+
declare const Hint: unique symbol;
|
|
19
|
+
declare const Modifier: unique symbol;
|
|
20
|
+
type TReadonly<T extends TSchema> = T & {
|
|
21
|
+
[Modifier]: 'Readonly';
|
|
22
|
+
};
|
|
23
|
+
type TOptional<T extends TSchema> = T & {
|
|
24
|
+
[Modifier]: 'Optional';
|
|
25
|
+
};
|
|
26
|
+
type TReadonlyOptional<T extends TSchema> = T & {
|
|
27
|
+
[Modifier]: 'ReadonlyOptional';
|
|
28
|
+
};
|
|
29
|
+
interface SchemaOptions {
|
|
30
|
+
$schema?: string;
|
|
31
|
+
/** Id for this schema */
|
|
32
|
+
$id?: string;
|
|
33
|
+
/** Title of this schema */
|
|
34
|
+
title?: string;
|
|
35
|
+
/** Description of this schema */
|
|
36
|
+
description?: string;
|
|
37
|
+
/** Default value for this schema */
|
|
38
|
+
default?: any;
|
|
39
|
+
/** Example values matching this schema. */
|
|
40
|
+
examples?: any;
|
|
41
|
+
[prop: string]: any;
|
|
42
|
+
}
|
|
43
|
+
interface TSchema extends SchemaOptions {
|
|
44
|
+
[Kind]: string;
|
|
45
|
+
[Hint]?: string;
|
|
46
|
+
[Modifier]?: string;
|
|
47
|
+
params: unknown[];
|
|
48
|
+
static: unknown;
|
|
49
|
+
}
|
|
50
|
+
interface NumericOptions extends SchemaOptions {
|
|
51
|
+
exclusiveMaximum?: number;
|
|
52
|
+
exclusiveMinimum?: number;
|
|
53
|
+
maximum?: number;
|
|
54
|
+
minimum?: number;
|
|
55
|
+
multipleOf?: number;
|
|
56
|
+
}
|
|
57
|
+
interface TBoolean extends TSchema {
|
|
58
|
+
[Kind]: 'Boolean';
|
|
59
|
+
static: boolean;
|
|
60
|
+
type: 'boolean';
|
|
61
|
+
}
|
|
62
|
+
interface TNull extends TSchema {
|
|
63
|
+
[Kind]: 'Null';
|
|
64
|
+
static: null;
|
|
65
|
+
type: 'null';
|
|
66
|
+
}
|
|
67
|
+
interface TNumber extends TSchema, NumericOptions {
|
|
68
|
+
[Kind]: 'Number';
|
|
69
|
+
static: number;
|
|
70
|
+
type: 'number';
|
|
71
|
+
}
|
|
72
|
+
type ReadonlyOptionalPropertyKeys<T extends TProperties> = {
|
|
73
|
+
[K in keyof T]: T[K] extends TReadonlyOptional<TSchema> ? K : never;
|
|
74
|
+
}[keyof T];
|
|
75
|
+
type ReadonlyPropertyKeys<T extends TProperties> = {
|
|
76
|
+
[K in keyof T]: T[K] extends TReadonly<TSchema> ? K : never;
|
|
77
|
+
}[keyof T];
|
|
78
|
+
type OptionalPropertyKeys<T extends TProperties> = {
|
|
79
|
+
[K in keyof T]: T[K] extends TOptional<TSchema> ? K : never;
|
|
80
|
+
}[keyof T];
|
|
81
|
+
type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
|
|
82
|
+
type PropertiesReducer<T extends TProperties, R extends Record<keyof any, unknown>> = (Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>) extends infer O ? {
|
|
83
|
+
[K in keyof O]: O[K];
|
|
84
|
+
} : never;
|
|
85
|
+
type PropertiesReduce<T extends TProperties, P extends unknown[]> = PropertiesReducer<T, {
|
|
86
|
+
[K in keyof T]: Static<T[K], P>;
|
|
87
|
+
}>;
|
|
88
|
+
interface TProperties {
|
|
89
|
+
[key: string]: TSchema;
|
|
90
|
+
}
|
|
91
|
+
type TAdditionalProperties = undefined | TSchema | boolean;
|
|
92
|
+
interface ObjectOptions extends SchemaOptions {
|
|
93
|
+
additionalProperties?: TAdditionalProperties;
|
|
94
|
+
minProperties?: number;
|
|
95
|
+
maxProperties?: number;
|
|
96
|
+
}
|
|
97
|
+
interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
|
|
98
|
+
[Kind]: 'Object';
|
|
99
|
+
static: PropertiesReduce<T, this['params']>;
|
|
100
|
+
additionalProperties?: TAdditionalProperties;
|
|
101
|
+
type: 'object';
|
|
102
|
+
properties: T;
|
|
103
|
+
required?: string[];
|
|
104
|
+
}
|
|
105
|
+
interface TPartial<T extends TObject> extends TObject {
|
|
106
|
+
static: Partial<Static<T, this['params']>>;
|
|
107
|
+
properties: {
|
|
108
|
+
[K in keyof T['properties']]: T['properties'][K] extends TReadonlyOptional<infer U> ? TReadonlyOptional<U> : T['properties'][K] extends TReadonly<infer U> ? TReadonlyOptional<U> : T['properties'][K] extends TOptional<infer U> ? TOptional<U> : TOptional<T['properties'][K]>;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
interface StringOptions<Format extends string> extends SchemaOptions {
|
|
112
|
+
minLength?: number;
|
|
113
|
+
maxLength?: number;
|
|
114
|
+
pattern?: string;
|
|
115
|
+
format?: Format;
|
|
116
|
+
contentEncoding?: '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64';
|
|
117
|
+
contentMediaType?: string;
|
|
118
|
+
}
|
|
119
|
+
interface TString<Format extends string = string> extends TSchema, StringOptions<Format> {
|
|
120
|
+
[Kind]: 'String';
|
|
121
|
+
static: string;
|
|
122
|
+
type: 'string';
|
|
123
|
+
}
|
|
124
|
+
/** Creates a static type from a TypeBox type */
|
|
125
|
+
type Static<T extends TSchema, P extends unknown[] = []> = (T & {
|
|
126
|
+
params: P;
|
|
127
|
+
})['static'];
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the MIT license found in the
|
|
133
|
+
* LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
declare const RawSnapshotFormat: TPartial<
|
|
138
|
+
TObject<{
|
|
139
|
+
callToJSON: TReadonly<TBoolean>;
|
|
140
|
+
compareKeys: TReadonly<TNull>;
|
|
141
|
+
escapeRegex: TReadonly<TBoolean>;
|
|
142
|
+
escapeString: TReadonly<TBoolean>;
|
|
143
|
+
highlight: TReadonly<TBoolean>;
|
|
144
|
+
indent: TReadonly<TNumber>;
|
|
145
|
+
maxDepth: TReadonly<TNumber>;
|
|
146
|
+
maxWidth: TReadonly<TNumber>;
|
|
147
|
+
min: TReadonly<TBoolean>;
|
|
148
|
+
printBasicPrototype: TReadonly<TBoolean>;
|
|
149
|
+
printFunctionName: TReadonly<TBoolean>;
|
|
150
|
+
theme: TReadonly<
|
|
151
|
+
TPartial<
|
|
152
|
+
TObject<{
|
|
153
|
+
comment: TReadonly<TString<string>>;
|
|
154
|
+
content: TReadonly<TString<string>>;
|
|
155
|
+
prop: TReadonly<TString<string>>;
|
|
156
|
+
tag: TReadonly<TString<string>>;
|
|
157
|
+
value: TReadonly<TString<string>>;
|
|
158
|
+
}>
|
|
159
|
+
>
|
|
160
|
+
>;
|
|
161
|
+
}>
|
|
162
|
+
>;
|
|
163
|
+
|
|
164
|
+
declare const SnapshotFormat: TPartial<
|
|
165
|
+
TObject<{
|
|
166
|
+
callToJSON: TReadonly<TBoolean>;
|
|
167
|
+
compareKeys: TReadonly<TNull>;
|
|
168
|
+
escapeRegex: TReadonly<TBoolean>;
|
|
169
|
+
escapeString: TReadonly<TBoolean>;
|
|
170
|
+
highlight: TReadonly<TBoolean>;
|
|
171
|
+
indent: TReadonly<TNumber>;
|
|
172
|
+
maxDepth: TReadonly<TNumber>;
|
|
173
|
+
maxWidth: TReadonly<TNumber>;
|
|
174
|
+
min: TReadonly<TBoolean>;
|
|
175
|
+
printBasicPrototype: TReadonly<TBoolean>;
|
|
176
|
+
printFunctionName: TReadonly<TBoolean>;
|
|
177
|
+
theme: TReadonly<
|
|
178
|
+
TPartial<
|
|
179
|
+
TObject<{
|
|
180
|
+
comment: TReadonly<TString<string>>;
|
|
181
|
+
content: TReadonly<TString<string>>;
|
|
182
|
+
prop: TReadonly<TString<string>>;
|
|
183
|
+
tag: TReadonly<TString<string>>;
|
|
184
|
+
value: TReadonly<TString<string>>;
|
|
185
|
+
}>
|
|
186
|
+
>
|
|
187
|
+
>;
|
|
188
|
+
}>
|
|
189
|
+
>;
|
|
190
|
+
|
|
191
|
+
declare type SnapshotFormat = Static<typeof RawSnapshotFormat>;
|
|
192
|
+
|
|
17
193
|
/**
|
|
18
|
-
* Copyright (c)
|
|
194
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
19
195
|
*
|
|
20
196
|
* This source code is licensed under the MIT license found in the
|
|
21
197
|
* LICENSE file in the root directory of this source tree.
|
|
22
198
|
*/
|
|
199
|
+
|
|
200
|
+
|
|
23
201
|
declare type Colors = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
202
|
+
comment: {
|
|
203
|
+
close: string;
|
|
204
|
+
open: string;
|
|
205
|
+
};
|
|
206
|
+
content: {
|
|
207
|
+
close: string;
|
|
208
|
+
open: string;
|
|
209
|
+
};
|
|
210
|
+
prop: {
|
|
211
|
+
close: string;
|
|
212
|
+
open: string;
|
|
213
|
+
};
|
|
214
|
+
tag: {
|
|
215
|
+
close: string;
|
|
216
|
+
open: string;
|
|
217
|
+
};
|
|
218
|
+
value: {
|
|
219
|
+
close: string;
|
|
220
|
+
open: string;
|
|
221
|
+
};
|
|
44
222
|
};
|
|
45
|
-
|
|
46
|
-
declare type
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
prop?: string;
|
|
52
|
-
tag?: string;
|
|
53
|
-
value?: string;
|
|
54
|
-
};
|
|
55
|
-
declare type CompareKeys = ((a: string, b: string) => number) | undefined;
|
|
56
|
-
interface PrettyFormatOptions {
|
|
57
|
-
callToJSON?: boolean;
|
|
58
|
-
compareKeys?: CompareKeys;
|
|
59
|
-
escapeRegex?: boolean;
|
|
60
|
-
escapeString?: boolean;
|
|
61
|
-
highlight?: boolean;
|
|
62
|
-
indent?: number;
|
|
63
|
-
maxDepth?: number;
|
|
64
|
-
min?: boolean;
|
|
65
|
-
plugins?: Plugins;
|
|
66
|
-
printBasicPrototype?: boolean;
|
|
67
|
-
printFunctionName?: boolean;
|
|
68
|
-
theme?: ThemeReceived;
|
|
69
|
-
}
|
|
223
|
+
|
|
224
|
+
declare type CompareKeys =
|
|
225
|
+
| ((a: string, b: string) => number)
|
|
226
|
+
| null
|
|
227
|
+
| undefined;
|
|
228
|
+
|
|
70
229
|
declare type Config = {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
230
|
+
callToJSON: boolean;
|
|
231
|
+
compareKeys: CompareKeys;
|
|
232
|
+
colors: Colors;
|
|
233
|
+
escapeRegex: boolean;
|
|
234
|
+
escapeString: boolean;
|
|
235
|
+
indent: string;
|
|
236
|
+
maxDepth: number;
|
|
237
|
+
maxWidth: number;
|
|
238
|
+
min: boolean;
|
|
239
|
+
plugins: Plugins;
|
|
240
|
+
printBasicPrototype: boolean;
|
|
241
|
+
printFunctionName: boolean;
|
|
242
|
+
spacingInner: string;
|
|
243
|
+
spacingOuter: string;
|
|
84
244
|
};
|
|
85
|
-
|
|
86
|
-
declare type
|
|
245
|
+
|
|
246
|
+
declare type Indent = (arg0: string) => string;
|
|
247
|
+
|
|
87
248
|
declare type NewPlugin = {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
249
|
+
serialize: (
|
|
250
|
+
val: any,
|
|
251
|
+
config: Config,
|
|
252
|
+
indentation: string,
|
|
253
|
+
depth: number,
|
|
254
|
+
refs: Refs,
|
|
255
|
+
printer: Printer,
|
|
256
|
+
) => string;
|
|
257
|
+
test: Test;
|
|
95
258
|
};
|
|
259
|
+
|
|
96
260
|
declare type OldPlugin = {
|
|
97
|
-
|
|
98
|
-
|
|
261
|
+
print: (
|
|
262
|
+
val: unknown,
|
|
263
|
+
print: Print,
|
|
264
|
+
indent: Indent,
|
|
265
|
+
options: PluginOptions,
|
|
266
|
+
colors: Colors,
|
|
267
|
+
) => string;
|
|
268
|
+
test: Test;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
declare type Plugin_2 = NewPlugin | OldPlugin;
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
declare type PluginOptions = {
|
|
275
|
+
edgeSpacing: string;
|
|
276
|
+
min: boolean;
|
|
277
|
+
spacing: string;
|
|
99
278
|
};
|
|
100
|
-
|
|
101
|
-
declare type Plugins = Array<
|
|
279
|
+
|
|
280
|
+
declare type Plugins = Array<Plugin_2>;
|
|
281
|
+
|
|
282
|
+
declare interface PrettyFormatOptions
|
|
283
|
+
extends Omit<SnapshotFormat, 'compareKeys'> {
|
|
284
|
+
compareKeys?: CompareKeys;
|
|
285
|
+
plugins?: Plugins;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
declare type Print = (arg0: unknown) => string;
|
|
289
|
+
|
|
290
|
+
declare type Printer = (
|
|
291
|
+
val: unknown,
|
|
292
|
+
config: Config,
|
|
293
|
+
indentation: string,
|
|
294
|
+
depth: number,
|
|
295
|
+
refs: Refs,
|
|
296
|
+
hasCalledToJSON?: boolean,
|
|
297
|
+
) => string;
|
|
298
|
+
|
|
299
|
+
declare type Refs = Array<unknown>;
|
|
300
|
+
|
|
301
|
+
declare type Test = (arg0: any) => boolean;
|
|
102
302
|
|
|
103
303
|
// Type definitions for @sinonjs/fake-timers 8.1
|
|
104
304
|
// Project: https://github.com/sinonjs/fake-timers
|
|
@@ -642,6 +842,8 @@ declare function createListRenderer(_tasks: Task[], options: ListRendererOptions
|
|
|
642
842
|
declare class DefaultReporter extends BaseReporter {
|
|
643
843
|
renderer?: ReturnType<typeof createListRenderer>;
|
|
644
844
|
rendererOptions: ListRendererOptions$1;
|
|
845
|
+
private renderSucceedDefault?;
|
|
846
|
+
onPathsCollected(paths?: string[]): void;
|
|
645
847
|
onTestRemoved(trigger?: string): Promise<void>;
|
|
646
848
|
onCollected(): void;
|
|
647
849
|
onFinished(files?: _vitest_runner.File[], errors?: unknown[]): Promise<void>;
|
|
@@ -800,6 +1002,12 @@ declare function setupChaiConfig(config: ChaiConfig): void;
|
|
|
800
1002
|
type ChaiConfig = Omit<Partial<typeof chai.config>, 'useProxy' | 'proxyExcludedKeys'>;
|
|
801
1003
|
|
|
802
1004
|
// Type definitions for istanbul-lib-report 3.0
|
|
1005
|
+
// Project: https://istanbul.js.org, https://github.com/istanbuljs/istanbuljs
|
|
1006
|
+
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
|
|
1007
|
+
// Zacharias Björngren <https://github.com/zache>
|
|
1008
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
1009
|
+
// TypeScript Version: 2.4
|
|
1010
|
+
|
|
803
1011
|
|
|
804
1012
|
|
|
805
1013
|
interface Node {
|
|
@@ -816,6 +1024,12 @@ interface Visitor<N extends Node = Node> {
|
|
|
816
1024
|
}
|
|
817
1025
|
|
|
818
1026
|
// Type definitions for istanbul-reports 3.0
|
|
1027
|
+
// Project: https://github.com/istanbuljs/istanbuljs, https://istanbul.js.org
|
|
1028
|
+
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
|
|
1029
|
+
// Elena Shcherbakova <https://github.com/not-a-doctor>
|
|
1030
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
1031
|
+
// TypeScript Version: 2.4
|
|
1032
|
+
|
|
819
1033
|
|
|
820
1034
|
|
|
821
1035
|
interface FileOptions {
|
|
@@ -1273,7 +1487,6 @@ interface BenchmarkUserOptions {
|
|
|
1273
1487
|
interface Benchmark extends TaskCustom {
|
|
1274
1488
|
meta: {
|
|
1275
1489
|
benchmark: true;
|
|
1276
|
-
task?: Task$1;
|
|
1277
1490
|
result?: TaskResult;
|
|
1278
1491
|
};
|
|
1279
1492
|
}
|
|
@@ -1283,7 +1496,7 @@ interface BenchmarkResult extends TaskResult {
|
|
|
1283
1496
|
}
|
|
1284
1497
|
type BenchFunction = (this: Bench) => Promise<void> | void;
|
|
1285
1498
|
type BenchmarkAPI = ChainableFunction<'skip' | 'only' | 'todo', [
|
|
1286
|
-
name: string,
|
|
1499
|
+
name: string | Function,
|
|
1287
1500
|
fn?: BenchFunction,
|
|
1288
1501
|
options?: Options
|
|
1289
1502
|
], void> & {
|
|
@@ -1318,6 +1531,11 @@ interface SequenceOptions {
|
|
|
1318
1531
|
* @default false
|
|
1319
1532
|
*/
|
|
1320
1533
|
shuffle?: boolean;
|
|
1534
|
+
/**
|
|
1535
|
+
* Should tests run in parallel.
|
|
1536
|
+
* @default false
|
|
1537
|
+
*/
|
|
1538
|
+
concurrent?: boolean;
|
|
1321
1539
|
/**
|
|
1322
1540
|
* Defines how setup files should be ordered
|
|
1323
1541
|
* - 'parallel' will run all setup files in parallel
|
|
@@ -1791,6 +2009,12 @@ interface InlineConfig {
|
|
|
1791
2009
|
* Stop test execution when given number of tests have failed.
|
|
1792
2010
|
*/
|
|
1793
2011
|
bail?: number;
|
|
2012
|
+
/**
|
|
2013
|
+
* Retry the test specific number of times if it fails.
|
|
2014
|
+
*
|
|
2015
|
+
* @default 0
|
|
2016
|
+
*/
|
|
2017
|
+
retry?: number;
|
|
1794
2018
|
}
|
|
1795
2019
|
interface TypecheckConfig {
|
|
1796
2020
|
/**
|
|
@@ -1883,6 +2107,7 @@ interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters'
|
|
|
1883
2107
|
hooks: SequenceHooks;
|
|
1884
2108
|
setupFiles: SequenceSetupFiles;
|
|
1885
2109
|
shuffle?: boolean;
|
|
2110
|
+
concurrent?: boolean;
|
|
1886
2111
|
seed: number;
|
|
1887
2112
|
};
|
|
1888
2113
|
typecheck: TypecheckConfig;
|
|
@@ -1914,7 +2139,7 @@ declare module '@vitest/expect' {
|
|
|
1914
2139
|
snapshotState: SnapshotState;
|
|
1915
2140
|
}
|
|
1916
2141
|
interface ExpectStatic {
|
|
1917
|
-
addSnapshotSerializer(plugin:
|
|
2142
|
+
addSnapshotSerializer(plugin: Plugin_2): void;
|
|
1918
2143
|
}
|
|
1919
2144
|
interface Assertion<T> {
|
|
1920
2145
|
matchSnapshot<U extends {
|
|
@@ -1980,4 +2205,4 @@ type Context = RootAndTarget & {
|
|
|
1980
2205
|
lastActivePath?: string;
|
|
1981
2206
|
};
|
|
1982
2207
|
|
|
1983
|
-
export {
|
|
2208
|
+
export { VitestEnvironment as $, AfterSuiteRunMeta as A, BaseCoverageOptions as B, CoverageOptions as C, Reporter as D, Environment as E, FileOptions as F, globalExpect as G, HtmlOptions as H, createExpect as I, setupChaiConfig as J, ChaiConfig as K, LcovOptions as L, MockFactory as M, RawErrsMap as N, TscErrorInfo as O, ProjectOptions as P, CollectLineNumbers as Q, ResolvedConfig as R, CollectLines as S, TeamcityOptions as T, UserConfig as U, VitestRunMode as V, WorkspaceSpec as W, RootAndTarget as X, Context as Y, JSDOMOptions as Z, BuiltinEnvironment as _, CoverageProvider as a, VitestPool as a0, CSSModuleScopeStrategy as a1, ApiConfig as a2, EnvironmentOptions as a3, DepsOptimizationOptions as a4, InlineConfig as a5, TypecheckConfig as a6, RuntimeRPC as a7, RunnerRPC as a8, ContextTestEnvironment as a9, ContextRPC as aa, WorkerContext as ab, ResolveIdFunction as ac, WorkerGlobalState as ad, Awaitable as ae, Nullable as af, Arrayable as ag, ArgumentsType$1 as ah, MutableArray as ai, Constructable as aj, ModuleCache as ak, EnvironmentReturn as al, OnServerRestartHandler as am, ReportContext as an, CoverageReporter as ao, BenchmarkUserOptions as ap, Benchmark as aq, BenchmarkResult as ar, BenchFunction as as, CoverageProviderModule as b, ResolvedCoverageOptions as c, CoverageV8Options as d, CoverageC8Options as e, CustomProviderOptions as f, CoverageIstanbulOptions as g, CloverOptions as h, CoberturaOptions as i, HtmlSpaOptions as j, LcovOnlyOptions as k, TextOptions as l, FakeTimerInstallOpts as m, ProjectConfig as n, Vitest as o, PendingSuiteMock as p, MockMap as q, TestSequencer as r, WorkspaceProject as s, startVitest as t, TestSequencerConstructor as u, BenchmarkAPI as v, MockFactoryWithHelper as w, RuntimeConfig as x, UserConsoleLog as y, ModuleGraphData as z };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
|
+
|
|
3
|
+
function getDefaultExportFromCjs (x) {
|
|
4
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { commonjsGlobal as c, getDefaultExportFromCjs as g };
|