vitest 0.0.64 → 0.0.65

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.
@@ -0,0 +1,19 @@
1
+ import {
2
+ init_esm_shims
3
+ } from "./chunk-RNHB4AXG.js";
4
+
5
+ // node_modules/.pnpm/nanoid@3.1.30/node_modules/nanoid/non-secure/index.js
6
+ init_esm_shims();
7
+ var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
8
+ var nanoid = (size = 21) => {
9
+ let id = "";
10
+ let i = size;
11
+ while (i--) {
12
+ id += urlAlphabet[Math.random() * 64 | 0];
13
+ }
14
+ return id;
15
+ };
16
+
17
+ export {
18
+ nanoid
19
+ };
@@ -0,0 +1,246 @@
1
+ import {
2
+ nanoid
3
+ } from "./chunk-3GMBTS5G.js";
4
+ import {
5
+ defaultHookTimeout,
6
+ defaultTestTimeout,
7
+ init_esm_shims
8
+ } from "./chunk-RNHB4AXG.js";
9
+
10
+ // src/runtime/suite.ts
11
+ init_esm_shims();
12
+
13
+ // src/runtime/context.ts
14
+ init_esm_shims();
15
+ var context = {
16
+ tasks: [],
17
+ currentSuite: null
18
+ };
19
+
20
+ // src/runtime/map.ts
21
+ init_esm_shims();
22
+ var fnMap = new WeakMap();
23
+ var hooksMap = new WeakMap();
24
+ function setFn(key, fn) {
25
+ fnMap.set(key, fn);
26
+ }
27
+ function getFn(key) {
28
+ return fnMap.get(key);
29
+ }
30
+ function setHooks(key, hooks) {
31
+ hooksMap.set(key, hooks);
32
+ }
33
+ function getHooks(key) {
34
+ return hooksMap.get(key);
35
+ }
36
+
37
+ // src/runtime/suite.ts
38
+ var suite = createSuite();
39
+ var defaultSuite = suite("");
40
+ function getCurrentSuite() {
41
+ return context.currentSuite || defaultSuite;
42
+ }
43
+ function createSuiteHooks() {
44
+ return {
45
+ beforeAll: [],
46
+ afterAll: [],
47
+ beforeEach: [],
48
+ afterEach: []
49
+ };
50
+ }
51
+ function createSuiteCollector(name, factory = () => {
52
+ }, mode, suiteComputeMode) {
53
+ var _a;
54
+ const tasks = [];
55
+ const factoryQueue = [];
56
+ let suite2;
57
+ initSuite();
58
+ const test2 = createTestCollector((name2, fn, mode2, computeMode) => {
59
+ const test3 = {
60
+ id: nanoid(),
61
+ type: "test",
62
+ name: name2,
63
+ mode: mode2,
64
+ computeMode: computeMode ?? (suiteComputeMode ?? "serial"),
65
+ suite: void 0
66
+ };
67
+ setFn(test3, fn);
68
+ tasks.push(test3);
69
+ });
70
+ const collector = {
71
+ type: "collector",
72
+ name,
73
+ mode,
74
+ test: test2,
75
+ tasks,
76
+ collect,
77
+ clear,
78
+ on: addHook
79
+ };
80
+ function addHook(name2, ...fn) {
81
+ getHooks(suite2)[name2].push(...fn);
82
+ }
83
+ function initSuite() {
84
+ suite2 = {
85
+ id: nanoid(),
86
+ type: "suite",
87
+ computeMode: "serial",
88
+ name,
89
+ mode,
90
+ tasks: []
91
+ };
92
+ setHooks(suite2, createSuiteHooks());
93
+ }
94
+ function clear() {
95
+ tasks.length = 0;
96
+ factoryQueue.length = 0;
97
+ initSuite();
98
+ }
99
+ async function collect(file) {
100
+ factoryQueue.length = 0;
101
+ if (factory) {
102
+ const prev = context.currentSuite;
103
+ context.currentSuite = collector;
104
+ await factory(test2);
105
+ context.currentSuite = prev;
106
+ }
107
+ const allChildren = await Promise.all([...factoryQueue, ...tasks].map((i) => i.type === "collector" ? i.collect(file) : i));
108
+ suite2.file = file;
109
+ suite2.tasks = allChildren;
110
+ allChildren.forEach((task) => {
111
+ task.suite = suite2;
112
+ if (file)
113
+ task.file = file;
114
+ });
115
+ return suite2;
116
+ }
117
+ (_a = context.currentSuite) == null ? void 0 : _a.tasks.push(collector);
118
+ return collector;
119
+ }
120
+ function createTestCollector(collectTest) {
121
+ function test2(name, fn, timeout) {
122
+ collectTest(name, withTimeout(fn, timeout), "run");
123
+ }
124
+ test2.concurrent = concurrent;
125
+ test2.skip = skip;
126
+ test2.only = only;
127
+ test2.todo = todo;
128
+ function concurrent(name, fn, timeout) {
129
+ collectTest(name, withTimeout(fn, timeout), "run", "concurrent");
130
+ }
131
+ concurrent.skip = (name, fn, timeout) => collectTest(name, withTimeout(fn, timeout), "skip", "concurrent");
132
+ concurrent.only = (name, fn, timeout) => collectTest(name, withTimeout(fn, timeout), "only", "concurrent");
133
+ concurrent.todo = todo;
134
+ function skip(name, fn, timeout) {
135
+ collectTest(name, withTimeout(fn, timeout), "skip");
136
+ }
137
+ skip.concurrent = concurrent.skip;
138
+ function only(name, fn, timeout) {
139
+ collectTest(name, withTimeout(fn, timeout), "only");
140
+ }
141
+ only.concurrent = concurrent.only;
142
+ function todo(name) {
143
+ collectTest(name, () => {
144
+ }, "todo");
145
+ }
146
+ todo.concurrent = todo;
147
+ return test2;
148
+ }
149
+ var test = function() {
150
+ function test2(name, fn, timeout) {
151
+ return getCurrentSuite().test(name, fn, timeout);
152
+ }
153
+ function concurrent(name, fn, timeout) {
154
+ return getCurrentSuite().test.concurrent(name, fn, timeout);
155
+ }
156
+ concurrent.skip = (name, fn, timeout) => getCurrentSuite().test.concurrent.skip(name, fn, timeout);
157
+ concurrent.only = (name, fn, timeout) => getCurrentSuite().test.concurrent.only(name, fn, timeout);
158
+ concurrent.todo = (name) => getCurrentSuite().test.concurrent.todo(name);
159
+ function skip(name, fn, timeout) {
160
+ return getCurrentSuite().test.skip(name, fn, timeout);
161
+ }
162
+ skip.concurrent = (name, fn, timeout) => getCurrentSuite().test.skip.concurrent(name, fn, timeout);
163
+ function only(name, fn, timeout) {
164
+ return getCurrentSuite().test.only(name, fn, timeout);
165
+ }
166
+ only.concurrent = (name, fn, timeout) => getCurrentSuite().test.only.concurrent(name, fn, timeout);
167
+ function todo(name) {
168
+ return getCurrentSuite().test.todo(name);
169
+ }
170
+ todo.concurrent = (name) => getCurrentSuite().test.todo.concurrent(name);
171
+ test2.concurrent = concurrent;
172
+ test2.skip = skip;
173
+ test2.only = only;
174
+ test2.todo = todo;
175
+ return test2;
176
+ }();
177
+ function createSuite() {
178
+ function suite2(suiteName, factory) {
179
+ return createSuiteCollector(suiteName, factory, "run");
180
+ }
181
+ function concurrent(suiteName, factory) {
182
+ return createSuiteCollector(suiteName, factory, "run", "concurrent");
183
+ }
184
+ concurrent.skip = (suiteName, factory) => createSuiteCollector(suiteName, factory, "skip", "concurrent");
185
+ concurrent.only = (suiteName, factory) => createSuiteCollector(suiteName, factory, "only", "concurrent");
186
+ concurrent.todo = (suiteName) => createSuiteCollector(suiteName, void 0, "todo");
187
+ function skip(suiteName, factory) {
188
+ return createSuiteCollector(suiteName, factory, "skip");
189
+ }
190
+ skip.concurrent = concurrent.skip;
191
+ function only(suiteName, factory) {
192
+ return createSuiteCollector(suiteName, factory, "only");
193
+ }
194
+ only.concurrent = concurrent.only;
195
+ function todo(suiteName) {
196
+ return createSuiteCollector(suiteName, void 0, "todo");
197
+ }
198
+ todo.concurrent = concurrent.todo;
199
+ suite2.concurrent = concurrent;
200
+ suite2.skip = skip;
201
+ suite2.only = only;
202
+ suite2.todo = todo;
203
+ return suite2;
204
+ }
205
+ var describe = suite;
206
+ var it = test;
207
+ var beforeAll = (fn, timeout = defaultHookTimeout) => getCurrentSuite().on("beforeAll", withTimeout(fn, timeout));
208
+ var afterAll = (fn, timeout = defaultHookTimeout) => getCurrentSuite().on("afterAll", withTimeout(fn, timeout));
209
+ var beforeEach = (fn, timeout = defaultHookTimeout) => getCurrentSuite().on("beforeEach", withTimeout(fn, timeout));
210
+ var afterEach = (fn, timeout = defaultHookTimeout) => getCurrentSuite().on("afterEach", withTimeout(fn, timeout));
211
+ function clearContext() {
212
+ context.tasks.length = 0;
213
+ defaultSuite.clear();
214
+ context.currentSuite = defaultSuite;
215
+ }
216
+ function withTimeout(fn, timeout = defaultTestTimeout) {
217
+ if (timeout <= 0 || timeout === Infinity)
218
+ return fn;
219
+ return (...args) => {
220
+ return Promise.race([fn(...args), new Promise((resolve, reject) => {
221
+ const timer = setTimeout(() => {
222
+ clearTimeout(timer);
223
+ reject(new Error(`Test timed out in ${timeout}ms.`));
224
+ }, timeout);
225
+ timer.unref();
226
+ })]);
227
+ };
228
+ }
229
+
230
+ export {
231
+ context,
232
+ getFn,
233
+ setHooks,
234
+ getHooks,
235
+ suite,
236
+ defaultSuite,
237
+ createSuiteHooks,
238
+ test,
239
+ describe,
240
+ it,
241
+ beforeAll,
242
+ afterAll,
243
+ beforeEach,
244
+ afterEach,
245
+ clearContext
246
+ };
@@ -0,0 +1,81 @@
1
+ import {
2
+ init_esm_shims
3
+ } from "./chunk-RNHB4AXG.js";
4
+
5
+ // src/utils.ts
6
+ init_esm_shims();
7
+ function toArray(array) {
8
+ array = array || [];
9
+ if (Array.isArray(array))
10
+ return array;
11
+ return [array];
12
+ }
13
+ function notNullish(v) {
14
+ return v != null;
15
+ }
16
+ function slash(str) {
17
+ return str.replace(/\\/g, "/");
18
+ }
19
+ function partitionSuiteChildren(suite) {
20
+ let tasksGroup = [];
21
+ const tasksGroups = [];
22
+ for (const c of suite.tasks) {
23
+ if (tasksGroup.length === 0 || c.computeMode === tasksGroup[0].computeMode) {
24
+ tasksGroup.push(c);
25
+ } else {
26
+ tasksGroups.push(tasksGroup);
27
+ tasksGroup = [c];
28
+ }
29
+ }
30
+ if (tasksGroup.length > 0)
31
+ tasksGroups.push(tasksGroup);
32
+ return tasksGroups;
33
+ }
34
+ function interpretOnlyMode(items) {
35
+ if (items.some((i) => i.mode === "only")) {
36
+ items.forEach((i) => {
37
+ if (i.mode === "run")
38
+ i.mode = "skip";
39
+ else if (i.mode === "only")
40
+ i.mode = "run";
41
+ });
42
+ }
43
+ }
44
+ function getTests(suite) {
45
+ return toArray(suite).flatMap((s) => s.tasks.flatMap((c) => c.type === "test" ? [c] : getTests(c)));
46
+ }
47
+ function getSuites(suite) {
48
+ return toArray(suite).flatMap((s) => s.type === "suite" ? [s, ...getSuites(s.tasks)] : []);
49
+ }
50
+ function hasTests(suite) {
51
+ return toArray(suite).some((s) => s.tasks.some((c) => c.type === "test" || hasTests(c)));
52
+ }
53
+ function hasFailed(suite) {
54
+ return toArray(suite).some((s) => {
55
+ var _a;
56
+ return ((_a = s.result) == null ? void 0 : _a.state) === "fail" || s.type === "suite" && hasFailed(s.tasks);
57
+ });
58
+ }
59
+ function getNames(task) {
60
+ const names = [task.name];
61
+ let current = task;
62
+ while ((current == null ? void 0 : current.suite) || (current == null ? void 0 : current.file)) {
63
+ current = current.suite || current.file;
64
+ if (current == null ? void 0 : current.name)
65
+ names.unshift(current.name);
66
+ }
67
+ return names;
68
+ }
69
+
70
+ export {
71
+ toArray,
72
+ notNullish,
73
+ slash,
74
+ partitionSuiteChildren,
75
+ interpretOnlyMode,
76
+ getTests,
77
+ getSuites,
78
+ hasTests,
79
+ hasFailed,
80
+ getNames
81
+ };
@@ -0,0 +1,128 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
25
+ var __esm = (fn, res) => function __init() {
26
+ return fn && (res = (0, fn[Object.keys(fn)[0]])(fn = 0)), res;
27
+ };
28
+ var __commonJS = (cb, mod) => function __require() {
29
+ return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
30
+ };
31
+ var __export = (target, all) => {
32
+ __markAsModule(target);
33
+ for (var name in all)
34
+ __defProp(target, name, { get: all[name], enumerable: true });
35
+ };
36
+ var __reExport = (target, module, desc) => {
37
+ if (module && typeof module === "object" || typeof module === "function") {
38
+ for (let key of __getOwnPropNames(module))
39
+ if (!__hasOwnProp.call(target, key) && key !== "default")
40
+ __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
41
+ }
42
+ return target;
43
+ };
44
+ var __toModule = (module) => {
45
+ return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
46
+ };
47
+ var __accessCheck = (obj, member, msg) => {
48
+ if (!member.has(obj))
49
+ throw TypeError("Cannot " + msg);
50
+ };
51
+ var __privateGet = (obj, member, getter) => {
52
+ __accessCheck(obj, member, "read from private field");
53
+ return getter ? getter.call(obj) : member.get(obj);
54
+ };
55
+ var __privateAdd = (obj, member, value) => {
56
+ if (member.has(obj))
57
+ throw TypeError("Cannot add the same private member more than once");
58
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
59
+ };
60
+ var __privateSet = (obj, member, value, setter) => {
61
+ __accessCheck(obj, member, "write to private field");
62
+ setter ? setter.call(obj, value) : member.set(obj, value);
63
+ return value;
64
+ };
65
+ var __privateWrapper = (obj, member, setter, getter) => {
66
+ return {
67
+ set _(value) {
68
+ __privateSet(obj, member, value, setter);
69
+ },
70
+ get _() {
71
+ return __privateGet(obj, member, getter);
72
+ }
73
+ };
74
+ };
75
+
76
+ // node_modules/.pnpm/tsup@5.11.1_typescript@4.5.3/node_modules/tsup/assets/esm_shims.js
77
+ import { fileURLToPath } from "url";
78
+ import path from "path";
79
+ var init_esm_shims = __esm({
80
+ "node_modules/.pnpm/tsup@5.11.1_typescript@4.5.3/node_modules/tsup/assets/esm_shims.js"() {
81
+ }
82
+ });
83
+
84
+ // src/constants.ts
85
+ init_esm_shims();
86
+ import { resolve } from "path";
87
+ import { fileURLToPath as fileURLToPath2 } from "url";
88
+ var distDir = resolve(fileURLToPath2(import.meta.url), "../../dist");
89
+ var defaultTestTimeout = 5e3;
90
+ var defaultHookTimeout = 5e3;
91
+ var defaultIncludes = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
92
+ var defaultExcludes = ["**/node_modules/**", "**/dist/**"];
93
+ var globalApis = [
94
+ "suite",
95
+ "test",
96
+ "describe",
97
+ "it",
98
+ "chai",
99
+ "expect",
100
+ "assert",
101
+ "sinon",
102
+ "spy",
103
+ "mock",
104
+ "stub",
105
+ "beforeAll",
106
+ "afterAll",
107
+ "beforeEach",
108
+ "afterEach"
109
+ ];
110
+
111
+ export {
112
+ __spreadValues,
113
+ __spreadProps,
114
+ __commonJS,
115
+ __export,
116
+ __toModule,
117
+ __privateGet,
118
+ __privateAdd,
119
+ __privateSet,
120
+ __privateWrapper,
121
+ init_esm_shims,
122
+ distDir,
123
+ defaultTestTimeout,
124
+ defaultHookTimeout,
125
+ defaultIncludes,
126
+ defaultExcludes,
127
+ globalApis
128
+ };
@@ -0,0 +1,78 @@
1
+ import {
2
+ init_esm_shims
3
+ } from "./chunk-RNHB4AXG.js";
4
+
5
+ // src/integrations/snapshot/port/jest-test-result-helper.ts
6
+ init_esm_shims();
7
+ var emptySummary = (options) => {
8
+ const summary = {
9
+ added: 0,
10
+ failure: false,
11
+ filesAdded: 0,
12
+ filesRemoved: 0,
13
+ filesRemovedList: [],
14
+ filesUnmatched: 0,
15
+ filesUpdated: 0,
16
+ matched: 0,
17
+ total: 0,
18
+ unchecked: 0,
19
+ uncheckedKeysByFile: [],
20
+ unmatched: 0,
21
+ updated: 0,
22
+ didUpdate: options.updateSnapshot === "all"
23
+ };
24
+ return summary;
25
+ };
26
+ var packSnapshotState = (filepath, state) => {
27
+ const snapshot = {
28
+ filepath,
29
+ added: 0,
30
+ fileDeleted: false,
31
+ matched: 0,
32
+ unchecked: 0,
33
+ uncheckedKeys: [],
34
+ unmatched: 0,
35
+ updated: 0
36
+ };
37
+ const uncheckedCount = state.getUncheckedCount();
38
+ const uncheckedKeys = state.getUncheckedKeys();
39
+ if (uncheckedCount)
40
+ state.removeUncheckedKeys();
41
+ const status = state.save();
42
+ snapshot.fileDeleted = status.deleted;
43
+ snapshot.added = state.added;
44
+ snapshot.matched = state.matched;
45
+ snapshot.unmatched = state.unmatched;
46
+ snapshot.updated = state.updated;
47
+ snapshot.unchecked = !status.deleted ? uncheckedCount : 0;
48
+ snapshot.uncheckedKeys = Array.from(uncheckedKeys);
49
+ return snapshot;
50
+ };
51
+ var addSnapshotResult = (summary, result) => {
52
+ if (result.added)
53
+ summary.filesAdded++;
54
+ if (result.fileDeleted)
55
+ summary.filesRemoved++;
56
+ if (result.unmatched)
57
+ summary.filesUnmatched++;
58
+ if (result.updated)
59
+ summary.filesUpdated++;
60
+ summary.added += result.added;
61
+ summary.matched += result.matched;
62
+ summary.unchecked += result.unchecked;
63
+ if (result.uncheckedKeys && result.uncheckedKeys.length > 0) {
64
+ summary.uncheckedKeysByFile.push({
65
+ filePath: result.filepath,
66
+ keys: result.uncheckedKeys
67
+ });
68
+ }
69
+ summary.unmatched += result.unmatched;
70
+ summary.updated += result.updated;
71
+ summary.total += result.added + result.matched + result.unmatched + result.updated;
72
+ };
73
+
74
+ export {
75
+ emptySummary,
76
+ packSnapshotState,
77
+ addSnapshotResult
78
+ };
@@ -0,0 +1,86 @@
1
+ import {
2
+ afterAll,
3
+ afterEach,
4
+ beforeAll,
5
+ beforeEach,
6
+ clearContext,
7
+ createSuiteHooks,
8
+ defaultSuite,
9
+ describe,
10
+ it,
11
+ suite,
12
+ test
13
+ } from "./chunk-LRXUKIDM.js";
14
+ import {
15
+ __export,
16
+ init_esm_shims
17
+ } from "./chunk-RNHB4AXG.js";
18
+
19
+ // src/index.ts
20
+ var src_exports = {};
21
+ __export(src_exports, {
22
+ afterAll: () => afterAll,
23
+ afterEach: () => afterEach,
24
+ assert: () => assert,
25
+ beforeAll: () => beforeAll,
26
+ beforeEach: () => beforeEach,
27
+ chai: () => chai,
28
+ clearContext: () => clearContext,
29
+ createSuiteHooks: () => createSuiteHooks,
30
+ defaultSuite: () => defaultSuite,
31
+ describe: () => describe,
32
+ expect: () => expect,
33
+ it: () => it,
34
+ mock: () => mock,
35
+ should: () => should,
36
+ sinon: () => sinon,
37
+ spy: () => spy,
38
+ stub: () => stub,
39
+ suite: () => suite,
40
+ test: () => test
41
+ });
42
+ init_esm_shims();
43
+
44
+ // src/types/index.ts
45
+ init_esm_shims();
46
+
47
+ // src/types/options.ts
48
+ init_esm_shims();
49
+
50
+ // src/types/tasks.ts
51
+ init_esm_shims();
52
+
53
+ // src/types/reporter.ts
54
+ init_esm_shims();
55
+
56
+ // src/types/snapshot.ts
57
+ init_esm_shims();
58
+
59
+ // src/types/worker.ts
60
+ init_esm_shims();
61
+
62
+ // src/types/general.ts
63
+ init_esm_shims();
64
+
65
+ // src/integrations/chai/index.ts
66
+ init_esm_shims();
67
+ import chai from "chai";
68
+ import { assert, should, expect } from "chai";
69
+
70
+ // src/integrations/sinon.ts
71
+ init_esm_shims();
72
+ import sinon from "sinon";
73
+ var { mock, spy, stub } = sinon;
74
+ sinon.fn = sinon.spy;
75
+
76
+ export {
77
+ chai,
78
+ assert,
79
+ should,
80
+ expect,
81
+ sinon,
82
+ mock,
83
+ spy,
84
+ stub,
85
+ src_exports
86
+ };
@@ -0,0 +1,20 @@
1
+ import {
2
+ src_exports
3
+ } from "./chunk-VAUJEKEW.js";
4
+ import "./chunk-LRXUKIDM.js";
5
+ import "./chunk-3GMBTS5G.js";
6
+ import {
7
+ globalApis,
8
+ init_esm_shims
9
+ } from "./chunk-RNHB4AXG.js";
10
+
11
+ // src/integrations/global.ts
12
+ init_esm_shims();
13
+ function registerApiGlobally() {
14
+ globalApis.forEach((api) => {
15
+ globalThis[api] = src_exports[api];
16
+ });
17
+ }
18
+ export {
19
+ registerApiGlobally
20
+ };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,10 @@
1
- import { R as ResolvedConfig, F as File, T as TaskResultPack, S as SnapshotResult, a as TestFactory, b as SuiteCollector, c as TestFunction, d as SuiteHooks, U as UserOptions } from './options-654578ef';
2
- export { C as CliOptions, g as ComputeMode, F as File, G as GlobalContext, H as HookListener, n as Reporter, R as ResolvedConfig, e as RunMode, o as SnapshotData, r as SnapshotMatchOptions, S as SnapshotResult, q as SnapshotStateOptions, t as SnapshotSummary, p as SnapshotUpdateState, j as Suite, b as SuiteCollector, d as SuiteHooks, l as Task, h as TaskBase, i as TaskResult, T as TaskResultPack, f as TaskState, k as Test, m as TestCollector, a as TestFactory, c as TestFunction, s as UncheckedSnapshot, U as UserOptions } from './options-654578ef';
1
+ import { R as ResolvedConfig, F as File, T as TaskResultPack, S as SnapshotResult, a as TestFactory, b as SuiteCollector, c as TestFunction, d as SuiteHooks, U as UserOptions } from './options-652352ad';
2
+ export { u as Arrayable, A as Awaitable, C as CliOptions, g as ComputeMode, v as Environment, E as EnvironmentReturn, F as File, G as GlobalContext, H as HookListener, M as ModuleCache, N as Nullable, n as Reporter, R as ResolvedConfig, e as RunMode, o as SnapshotData, r as SnapshotMatchOptions, S as SnapshotResult, q as SnapshotStateOptions, t as SnapshotSummary, p as SnapshotUpdateState, j as Suite, b as SuiteCollector, d as SuiteHooks, l as Task, h as TaskBase, i as TaskResult, T as TaskResultPack, f as TaskState, k as Test, m as TestCollector, a as TestFactory, c as TestFunction, s as UncheckedSnapshot, U as UserOptions, V as VitestContext } from './options-652352ad';
3
3
  import { MessagePort } from 'worker_threads';
4
4
  import { TransformResult } from 'vite';
5
- export { a as Environment, E as EnvironmentReturn, M as ModuleCache, V as VitestContext } from './general-39d52683';
6
5
  export { assert, default as chai, expect, should } from 'chai';
7
6
  import sinon from 'sinon';
8
7
  export { default as sinon } from 'sinon';
9
- import '@antfu/utils';
10
8
  import 'pretty-format';
11
9
 
12
10
  interface WorkerContext {