vitest 0.0.89 → 0.0.93

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.
@@ -1,6 +1,6 @@
1
1
  import { existsSync, promises } from 'fs';
2
2
  import { relative } from 'path';
3
- import { n as notNullish, c } from './utils-385e2d09.js';
3
+ import { d as notNullish, c } from './utils-576876dc.js';
4
4
  import { SourceMapConsumer } from 'source-map';
5
5
 
6
6
  function Diff() {}
@@ -1,5 +1,5 @@
1
- import { g as globalApis } from './constants-adef7ffb.js';
2
- import { i as index } from './index-722fb5a5.js';
1
+ import { g as globalApis } from './constants-9cfa4d7b.js';
2
+ import { i as index } from './index-708135df.js';
3
3
  import 'path';
4
4
  import 'url';
5
5
  import './suite-b8c6cb53.js';
@@ -0,0 +1,331 @@
1
+ import assert$1 from 'assert';
2
+ import require$$2 from 'events';
3
+
4
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
+
6
+ var onetime$2 = {exports: {}};
7
+
8
+ var mimicFn$2 = {exports: {}};
9
+
10
+ const mimicFn$1 = (to, from) => {
11
+ for (const prop of Reflect.ownKeys(from)) {
12
+ Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
13
+ }
14
+
15
+ return to;
16
+ };
17
+
18
+ mimicFn$2.exports = mimicFn$1;
19
+ // TODO: Remove this for the next major release
20
+ mimicFn$2.exports.default = mimicFn$1;
21
+
22
+ const mimicFn = mimicFn$2.exports;
23
+
24
+ const calledFunctions = new WeakMap();
25
+
26
+ const onetime = (function_, options = {}) => {
27
+ if (typeof function_ !== 'function') {
28
+ throw new TypeError('Expected a function');
29
+ }
30
+
31
+ let returnValue;
32
+ let callCount = 0;
33
+ const functionName = function_.displayName || function_.name || '<anonymous>';
34
+
35
+ const onetime = function (...arguments_) {
36
+ calledFunctions.set(onetime, ++callCount);
37
+
38
+ if (callCount === 1) {
39
+ returnValue = function_.apply(this, arguments_);
40
+ function_ = null;
41
+ } else if (options.throw === true) {
42
+ throw new Error(`Function \`${functionName}\` can only be called once`);
43
+ }
44
+
45
+ return returnValue;
46
+ };
47
+
48
+ mimicFn(onetime, function_);
49
+ calledFunctions.set(onetime, callCount);
50
+
51
+ return onetime;
52
+ };
53
+
54
+ onetime$2.exports = onetime;
55
+ // TODO: Remove this for the next major release
56
+ onetime$2.exports.default = onetime;
57
+
58
+ onetime$2.exports.callCount = function_ => {
59
+ if (!calledFunctions.has(function_)) {
60
+ throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
61
+ }
62
+
63
+ return calledFunctions.get(function_);
64
+ };
65
+
66
+ var onetime$1 = onetime$2.exports;
67
+
68
+ var signalExit$1 = {exports: {}};
69
+
70
+ var signals$1 = {exports: {}};
71
+
72
+ (function (module) {
73
+ // This is not the set of all possible signals.
74
+ //
75
+ // It IS, however, the set of all signals that trigger
76
+ // an exit on either Linux or BSD systems. Linux is a
77
+ // superset of the signal names supported on BSD, and
78
+ // the unknown signals just fail to register, so we can
79
+ // catch that easily enough.
80
+ //
81
+ // Don't bother with SIGKILL. It's uncatchable, which
82
+ // means that we can't fire any callbacks anyway.
83
+ //
84
+ // If a user does happen to register a handler on a non-
85
+ // fatal signal like SIGWINCH or something, and then
86
+ // exit, it'll end up firing `process.emit('exit')`, so
87
+ // the handler will be fired anyway.
88
+ //
89
+ // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
90
+ // artificially, inherently leave the process in a
91
+ // state from which it is not safe to try and enter JS
92
+ // listeners.
93
+ module.exports = [
94
+ 'SIGABRT',
95
+ 'SIGALRM',
96
+ 'SIGHUP',
97
+ 'SIGINT',
98
+ 'SIGTERM'
99
+ ];
100
+
101
+ if (process.platform !== 'win32') {
102
+ module.exports.push(
103
+ 'SIGVTALRM',
104
+ 'SIGXCPU',
105
+ 'SIGXFSZ',
106
+ 'SIGUSR2',
107
+ 'SIGTRAP',
108
+ 'SIGSYS',
109
+ 'SIGQUIT',
110
+ 'SIGIOT'
111
+ // should detect profiler and enable/disable accordingly.
112
+ // see #21
113
+ // 'SIGPROF'
114
+ );
115
+ }
116
+
117
+ if (process.platform === 'linux') {
118
+ module.exports.push(
119
+ 'SIGIO',
120
+ 'SIGPOLL',
121
+ 'SIGPWR',
122
+ 'SIGSTKFLT',
123
+ 'SIGUNUSED'
124
+ );
125
+ }
126
+ }(signals$1));
127
+
128
+ // Note: since nyc uses this module to output coverage, any lines
129
+ // that are in the direct sync flow of nyc's outputCoverage are
130
+ // ignored, since we can never get coverage for them.
131
+ // grab a reference to node's real process object right away
132
+ var process$1 = commonjsGlobal.process;
133
+
134
+ const processOk = function (process) {
135
+ return process &&
136
+ typeof process === 'object' &&
137
+ typeof process.removeListener === 'function' &&
138
+ typeof process.emit === 'function' &&
139
+ typeof process.reallyExit === 'function' &&
140
+ typeof process.listeners === 'function' &&
141
+ typeof process.kill === 'function' &&
142
+ typeof process.pid === 'number' &&
143
+ typeof process.on === 'function'
144
+ };
145
+
146
+ // some kind of non-node environment, just no-op
147
+ /* istanbul ignore if */
148
+ if (!processOk(process$1)) {
149
+ signalExit$1.exports = function () {};
150
+ } else {
151
+ var assert = assert$1;
152
+ var signals = signals$1.exports;
153
+ var isWin = /^win/i.test(process$1.platform);
154
+
155
+ var EE = require$$2;
156
+ /* istanbul ignore if */
157
+ if (typeof EE !== 'function') {
158
+ EE = EE.EventEmitter;
159
+ }
160
+
161
+ var emitter;
162
+ if (process$1.__signal_exit_emitter__) {
163
+ emitter = process$1.__signal_exit_emitter__;
164
+ } else {
165
+ emitter = process$1.__signal_exit_emitter__ = new EE();
166
+ emitter.count = 0;
167
+ emitter.emitted = {};
168
+ }
169
+
170
+ // Because this emitter is a global, we have to check to see if a
171
+ // previous version of this library failed to enable infinite listeners.
172
+ // I know what you're about to say. But literally everything about
173
+ // signal-exit is a compromise with evil. Get used to it.
174
+ if (!emitter.infinite) {
175
+ emitter.setMaxListeners(Infinity);
176
+ emitter.infinite = true;
177
+ }
178
+
179
+ signalExit$1.exports = function (cb, opts) {
180
+ /* istanbul ignore if */
181
+ if (!processOk(commonjsGlobal.process)) {
182
+ return
183
+ }
184
+ assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler');
185
+
186
+ if (loaded === false) {
187
+ load();
188
+ }
189
+
190
+ var ev = 'exit';
191
+ if (opts && opts.alwaysLast) {
192
+ ev = 'afterexit';
193
+ }
194
+
195
+ var remove = function () {
196
+ emitter.removeListener(ev, cb);
197
+ if (emitter.listeners('exit').length === 0 &&
198
+ emitter.listeners('afterexit').length === 0) {
199
+ unload();
200
+ }
201
+ };
202
+ emitter.on(ev, cb);
203
+
204
+ return remove
205
+ };
206
+
207
+ var unload = function unload () {
208
+ if (!loaded || !processOk(commonjsGlobal.process)) {
209
+ return
210
+ }
211
+ loaded = false;
212
+
213
+ signals.forEach(function (sig) {
214
+ try {
215
+ process$1.removeListener(sig, sigListeners[sig]);
216
+ } catch (er) {}
217
+ });
218
+ process$1.emit = originalProcessEmit;
219
+ process$1.reallyExit = originalProcessReallyExit;
220
+ emitter.count -= 1;
221
+ };
222
+ signalExit$1.exports.unload = unload;
223
+
224
+ var emit = function emit (event, code, signal) {
225
+ /* istanbul ignore if */
226
+ if (emitter.emitted[event]) {
227
+ return
228
+ }
229
+ emitter.emitted[event] = true;
230
+ emitter.emit(event, code, signal);
231
+ };
232
+
233
+ // { <signal>: <listener fn>, ... }
234
+ var sigListeners = {};
235
+ signals.forEach(function (sig) {
236
+ sigListeners[sig] = function listener () {
237
+ /* istanbul ignore if */
238
+ if (!processOk(commonjsGlobal.process)) {
239
+ return
240
+ }
241
+ // If there are no other listeners, an exit is coming!
242
+ // Simplest way: remove us and then re-send the signal.
243
+ // We know that this will kill the process, so we can
244
+ // safely emit now.
245
+ var listeners = process$1.listeners(sig);
246
+ if (listeners.length === emitter.count) {
247
+ unload();
248
+ emit('exit', null, sig);
249
+ /* istanbul ignore next */
250
+ emit('afterexit', null, sig);
251
+ /* istanbul ignore next */
252
+ if (isWin && sig === 'SIGHUP') {
253
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
254
+ // so use a supported signal instead
255
+ sig = 'SIGINT';
256
+ }
257
+ /* istanbul ignore next */
258
+ process$1.kill(process$1.pid, sig);
259
+ }
260
+ };
261
+ });
262
+
263
+ signalExit$1.exports.signals = function () {
264
+ return signals
265
+ };
266
+
267
+ var loaded = false;
268
+
269
+ var load = function load () {
270
+ if (loaded || !processOk(commonjsGlobal.process)) {
271
+ return
272
+ }
273
+ loaded = true;
274
+
275
+ // This is the number of onSignalExit's that are in play.
276
+ // It's important so that we can count the correct number of
277
+ // listeners on signals, and don't wait for the other one to
278
+ // handle it instead of us.
279
+ emitter.count += 1;
280
+
281
+ signals = signals.filter(function (sig) {
282
+ try {
283
+ process$1.on(sig, sigListeners[sig]);
284
+ return true
285
+ } catch (er) {
286
+ return false
287
+ }
288
+ });
289
+
290
+ process$1.emit = processEmit;
291
+ process$1.reallyExit = processReallyExit;
292
+ };
293
+ signalExit$1.exports.load = load;
294
+
295
+ var originalProcessReallyExit = process$1.reallyExit;
296
+ var processReallyExit = function processReallyExit (code) {
297
+ /* istanbul ignore if */
298
+ if (!processOk(commonjsGlobal.process)) {
299
+ return
300
+ }
301
+ process$1.exitCode = code || /* istanbul ignore next */ 0;
302
+ emit('exit', process$1.exitCode, null);
303
+ /* istanbul ignore next */
304
+ emit('afterexit', process$1.exitCode, null);
305
+ /* istanbul ignore next */
306
+ originalProcessReallyExit.call(process$1, process$1.exitCode);
307
+ };
308
+
309
+ var originalProcessEmit = process$1.emit;
310
+ var processEmit = function processEmit (ev, arg) {
311
+ if (ev === 'exit' && processOk(commonjsGlobal.process)) {
312
+ /* istanbul ignore else */
313
+ if (arg !== undefined) {
314
+ process$1.exitCode = arg;
315
+ }
316
+ var ret = originalProcessEmit.apply(this, arguments);
317
+ /* istanbul ignore next */
318
+ emit('exit', process$1.exitCode, null);
319
+ /* istanbul ignore next */
320
+ emit('afterexit', process$1.exitCode, null);
321
+ /* istanbul ignore next */
322
+ return ret
323
+ } else {
324
+ return originalProcessEmit.apply(this, arguments)
325
+ }
326
+ };
327
+ }
328
+
329
+ var signalExit = signalExit$1.exports;
330
+
331
+ export { signalExit$1 as a, onetime$2 as b, commonjsGlobal as c, onetime$1 as o, signalExit as s };
@@ -0,0 +1,333 @@
1
+ import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it } from './suite-b8c6cb53.js';
2
+ import chai, { util, assert, should, expect } from 'chai';
3
+ import * as tinyspy from 'tinyspy';
4
+ import { spy, spyOn as spyOn$1 } from 'tinyspy';
5
+
6
+ const beforeAll = (fn, timeout) => getCurrentSuite().on("beforeAll", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
7
+ const afterAll = (fn, timeout) => getCurrentSuite().on("afterAll", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
8
+ const beforeEach = (fn, timeout) => getCurrentSuite().on("beforeEach", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
9
+ const afterEach = (fn, timeout) => getCurrentSuite().on("afterEach", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
10
+
11
+ function spyOn(obj, method, accessType) {
12
+ const dictionary = {
13
+ get: "getter",
14
+ set: "setter"
15
+ };
16
+ const objMethod = accessType ? { [dictionary[accessType]]: method } : method;
17
+ const stub = tinyspy.spyOn(obj, objMethod);
18
+ return enhanceSpy(stub);
19
+ }
20
+ function enhanceSpy(spy) {
21
+ const stub = spy;
22
+ let implementation;
23
+ const instances = [];
24
+ const mockContext = {
25
+ get calls() {
26
+ return stub.calls;
27
+ },
28
+ get instances() {
29
+ return instances;
30
+ },
31
+ get invocationCallOrder() {
32
+ return [];
33
+ },
34
+ get results() {
35
+ return stub.results.map(([callType, value]) => {
36
+ const type = callType === "error" ? "throw" : "return";
37
+ return { type, value };
38
+ });
39
+ }
40
+ };
41
+ let onceImplementations = [];
42
+ let name = "";
43
+ Object.defineProperty(stub, "name", {
44
+ get: () => name
45
+ });
46
+ stub.getMockName = () => name || "vi.fn()";
47
+ stub.mockName = (n) => {
48
+ name = n;
49
+ return stub;
50
+ };
51
+ stub.mockClear = () => {
52
+ stub.reset();
53
+ return stub;
54
+ };
55
+ stub.mockReset = () => {
56
+ stub.reset();
57
+ return stub;
58
+ };
59
+ stub.mockRestore = () => {
60
+ implementation = void 0;
61
+ onceImplementations = [];
62
+ stub.reset();
63
+ stub.restore();
64
+ return stub;
65
+ };
66
+ stub.getMockImplementation = () => implementation;
67
+ stub.mockImplementation = (fn2) => {
68
+ implementation = fn2;
69
+ return stub;
70
+ };
71
+ stub.mockImplementationOnce = (fn2) => {
72
+ onceImplementations.push(fn2);
73
+ return stub;
74
+ };
75
+ stub.mockReturnThis = () => stub.mockImplementation(function() {
76
+ return this;
77
+ });
78
+ stub.mockReturnValue = (val) => stub.mockImplementation(() => val);
79
+ stub.mockReturnValueOnce = (val) => stub.mockImplementationOnce(() => val);
80
+ stub.mockResolvedValue = (val) => stub.mockImplementation(() => Promise.resolve(val));
81
+ stub.mockResolvedValueOnce = (val) => stub.mockImplementationOnce(() => Promise.resolve(val));
82
+ stub.mockRejectedValue = (val) => stub.mockImplementation(() => Promise.reject(val));
83
+ stub.mockRejectedValueOnce = (val) => stub.mockImplementation(() => Promise.reject(val));
84
+ util.addProperty(stub, "mock", () => mockContext);
85
+ stub.willCall(function(...args) {
86
+ instances.push(this);
87
+ const impl = onceImplementations.shift() || implementation || stub.getOriginal() || (() => {
88
+ });
89
+ return impl.apply(this, args);
90
+ });
91
+ return stub;
92
+ }
93
+ function fn(implementation) {
94
+ return enhanceSpy(tinyspy.spyOn({ fn: implementation || (() => {
95
+ }) }, "fn"));
96
+ }
97
+
98
+ const originalSetTimeout = global.setTimeout;
99
+ const originalSetInterval = global.setInterval;
100
+ const originalClearTimeout = global.clearTimeout;
101
+ const originalClearInterval = global.clearInterval;
102
+ const MAX_LOOPS = 1e4;
103
+ const assertEvery = (assertions, message) => {
104
+ if (assertions.some((a) => !a))
105
+ throw new Error(message);
106
+ };
107
+ const assertMaxLoop = (times) => {
108
+ if (times >= MAX_LOOPS)
109
+ throw new Error("setTimeout/setInterval called 10 000 times. It's possible it stuck in an infinite loop.");
110
+ };
111
+ const getNodeTimeout = (id) => {
112
+ const timer = {
113
+ ref: () => timer,
114
+ unref: () => timer,
115
+ hasRef: () => true,
116
+ refresh: () => timer,
117
+ [Symbol.toPrimitive]: () => id
118
+ };
119
+ return timer;
120
+ };
121
+ class FakeTimers {
122
+ constructor() {
123
+ this._advancedTime = 0;
124
+ this._nestedTime = {};
125
+ this._scopeId = 0;
126
+ this._isNested = false;
127
+ this._isOnlyPending = false;
128
+ this._spyid = 0;
129
+ this._isMocked = false;
130
+ this._tasksQueue = [];
131
+ this._queueCount = 0;
132
+ }
133
+ useFakeTimers() {
134
+ this._isMocked = true;
135
+ this.reset();
136
+ const spyFactory = (spyType, resultBuilder) => {
137
+ return (cb, ms = 0) => {
138
+ const id = ++this._spyid;
139
+ const nestedMs = ms + (this._nestedTime[this._scopeId] ?? 0);
140
+ const call = { id, cb, ms, nestedMs, scopeId: this._scopeId };
141
+ const task = { type: spyType, call, nested: this._isNested };
142
+ this.pushTask(task);
143
+ return resultBuilder(id, cb);
144
+ };
145
+ };
146
+ this._setTimeout = spyOn(global, "setTimeout").mockImplementation(spyFactory("timeout" /* Timeout */, getNodeTimeout));
147
+ this._setInterval = spyOn(global, "setInterval").mockImplementation(spyFactory("interval" /* Interval */, getNodeTimeout));
148
+ const clearTimerFactory = (spyType) => (id) => {
149
+ if (id === void 0)
150
+ return;
151
+ const index = this._tasksQueue.findIndex(({ call, type }) => type === spyType && call.id === Number(id));
152
+ if (index !== -1)
153
+ this._tasksQueue.splice(index, 1);
154
+ };
155
+ this._clearTimeout = spyOn(global, "clearTimeout").mockImplementation(clearTimerFactory("timeout" /* Timeout */));
156
+ this._clearInterval = spyOn(global, "clearInterval").mockImplementation(clearTimerFactory("interval" /* Interval */));
157
+ }
158
+ useRealTimers() {
159
+ this._isMocked = false;
160
+ this.reset();
161
+ global.setTimeout = originalSetTimeout;
162
+ global.setInterval = originalSetInterval;
163
+ global.clearTimeout = originalClearTimeout;
164
+ global.clearInterval = originalClearInterval;
165
+ }
166
+ runOnlyPendingTimers() {
167
+ this.assertMocked();
168
+ this._isOnlyPending = true;
169
+ this.runQueue();
170
+ }
171
+ runAllTimers() {
172
+ this.assertMocked();
173
+ this.runQueue();
174
+ }
175
+ advanceTimersByTime(ms) {
176
+ this.assertMocked();
177
+ this._advancedTime += ms;
178
+ this.runQueue();
179
+ }
180
+ advanceTimersToNextTimer() {
181
+ throw new Error("advanceTimersToNextTimer is not implemented");
182
+ }
183
+ runAllTicks() {
184
+ throw new Error("runAllTicks is not implemented");
185
+ }
186
+ setSystemTime(now) {
187
+ throw new Error("setSystemTime is not implemented");
188
+ }
189
+ getRealSystemTime() {
190
+ return Date.now();
191
+ }
192
+ getTimerCount() {
193
+ this.assertMocked();
194
+ return this._tasksQueue.length;
195
+ }
196
+ reset() {
197
+ var _a, _b, _c, _d;
198
+ this._advancedTime = 0;
199
+ this._nestedTime = {};
200
+ this._isNested = false;
201
+ this._isOnlyPending = false;
202
+ this._spyid = 0;
203
+ this._queueCount = 0;
204
+ this._tasksQueue = [];
205
+ (_a = this._clearInterval) == null ? void 0 : _a.mockRestore();
206
+ (_b = this._clearTimeout) == null ? void 0 : _b.mockRestore();
207
+ (_c = this._setInterval) == null ? void 0 : _c.mockRestore();
208
+ (_d = this._setTimeout) == null ? void 0 : _d.mockRestore();
209
+ }
210
+ runQueue() {
211
+ var _a, _b;
212
+ let index = 0;
213
+ while (this._tasksQueue[index]) {
214
+ assertMaxLoop(this._queueCount);
215
+ const task = this._tasksQueue[index];
216
+ const { call, nested, type } = task;
217
+ if (this._advancedTime && call.nestedMs > this._advancedTime)
218
+ break;
219
+ if (this._isOnlyPending && nested) {
220
+ index++;
221
+ continue;
222
+ }
223
+ this._scopeId = call.id;
224
+ this._isNested = true;
225
+ (_a = this._nestedTime)[_b = call.id] ?? (_a[_b] = 0);
226
+ this._nestedTime[call.id] += call.ms;
227
+ if (type === "timeout") {
228
+ this.removeTask(index);
229
+ } else if (type === "interval") {
230
+ call.nestedMs += call.ms;
231
+ const nestedMs = call.nestedMs;
232
+ const closestTask = this._tasksQueue.findIndex(({ type: type2, call: call2 }) => type2 === "interval" && call2.nestedMs < nestedMs);
233
+ if (closestTask !== -1 && closestTask !== index)
234
+ this.ensureQueueOrder();
235
+ }
236
+ call.cb();
237
+ this._queueCount++;
238
+ }
239
+ }
240
+ removeTask(index) {
241
+ if (index === 0)
242
+ this._tasksQueue.shift();
243
+ else
244
+ this._tasksQueue.splice(index, 1);
245
+ }
246
+ pushTask(task) {
247
+ this._tasksQueue.push(task);
248
+ this.ensureQueueOrder();
249
+ }
250
+ ensureQueueOrder() {
251
+ this._tasksQueue.sort((t1, t2) => {
252
+ const diff = t1.call.nestedMs - t2.call.nestedMs;
253
+ if (diff === 0) {
254
+ if (t1.type === "immediate" /* Immediate */ && t2.type !== "immediate" /* Immediate */)
255
+ return 1;
256
+ return 0;
257
+ }
258
+ return diff;
259
+ });
260
+ }
261
+ assertMocked() {
262
+ assertEvery([
263
+ this._isMocked,
264
+ this._setTimeout,
265
+ this._setInterval,
266
+ this._clearTimeout,
267
+ this._clearInterval
268
+ ], 'timers are not mocked. try calling "vitest.useFakeTimers()" first');
269
+ }
270
+ }
271
+
272
+ class VitestUtils {
273
+ constructor() {
274
+ this.spyOn = spyOn;
275
+ this.fn = fn;
276
+ this.mock = (path) => path;
277
+ this._timers = new FakeTimers();
278
+ }
279
+ useFakeTimers() {
280
+ return this._timers.useFakeTimers();
281
+ }
282
+ useRealTimers() {
283
+ return this._timers.useRealTimers();
284
+ }
285
+ runOnlyPendingTimers() {
286
+ return this._timers.runOnlyPendingTimers();
287
+ }
288
+ runAllTimers() {
289
+ return this._timers.runAllTimers();
290
+ }
291
+ advanceTimersByTime(ms) {
292
+ return this._timers.advanceTimersByTime(ms);
293
+ }
294
+ advanceTimersToNextTimer() {
295
+ return this._timers.advanceTimersToNextTimer();
296
+ }
297
+ runAllTicks() {
298
+ return this._timers.runAllTicks();
299
+ }
300
+ setSystemTime(time) {
301
+ return this._timers.setSystemTime(time);
302
+ }
303
+ getRealSystemTime() {
304
+ return this._timers.getRealSystemTime();
305
+ }
306
+ getTimerCount() {
307
+ return this._timers.getTimerCount();
308
+ }
309
+ }
310
+ const vitest = new VitestUtils();
311
+ const vi = vitest;
312
+
313
+ var index = /*#__PURE__*/Object.freeze({
314
+ __proto__: null,
315
+ suite: suite,
316
+ test: test,
317
+ describe: describe,
318
+ it: it,
319
+ beforeAll: beforeAll,
320
+ afterAll: afterAll,
321
+ beforeEach: beforeEach,
322
+ afterEach: afterEach,
323
+ assert: assert,
324
+ should: should,
325
+ expect: expect,
326
+ chai: chai,
327
+ spy: spy,
328
+ spyOn: spyOn$1,
329
+ vitest: vitest,
330
+ vi: vi
331
+ });
332
+
333
+ export { afterAll as a, beforeAll as b, beforeEach as c, afterEach as d, vi as e, index as i, vitest as v };