vitest 0.22.0 → 0.22.1
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/dist/browser.d.ts +3 -3
- package/dist/browser.mjs +8 -7
- package/dist/{chunk-api-setup.ecd02c18.mjs → chunk-api-setup.377c28aa.mjs} +7 -8
- package/dist/chunk-constants.71e8a211.mjs +284 -0
- package/dist/{chunk-integrations-globals.e81d2091.mjs → chunk-integrations-globals.60af7da3.mjs} +8 -9
- package/dist/{chunk-mock-date.debe9954.mjs → chunk-mock-date.304e29b1.mjs} +6 -189
- package/dist/{chunk-node-git.71b74da4.mjs → chunk-node-git.9a7e3153.mjs} +3 -5
- package/dist/{chunk-runtime-chain.6e363ba2.mjs → chunk-runtime-chain.be610650.mjs} +4 -4
- package/dist/{chunk-runtime-error.975bd80a.mjs → chunk-runtime-error.1104e45a.mjs} +10 -10
- package/dist/{chunk-runtime-hooks.4789e99d.mjs → chunk-runtime-hooks.5d7073db.mjs} +3 -3
- package/dist/{chunk-runtime-mocker.c91d29ce.mjs → chunk-runtime-mocker.49d21aa6.mjs} +4 -4
- package/dist/{chunk-runtime-rpc.29488183.mjs → chunk-runtime-rpc.57586b73.mjs} +1 -1
- package/dist/{chunk-utils-source-map.2a082ffd.mjs → chunk-utils-source-map.bbf3ad19.mjs} +2 -2
- package/dist/{chunk-vite-node-client.d1ead698.mjs → chunk-vite-node-client.cddda63d.mjs} +44 -20
- package/dist/{chunk-vite-node-debug.ff1d2a9f.mjs → chunk-vite-node-debug.536c4c5b.mjs} +3 -4
- package/dist/{chunk-vite-node-externalize.3a38c8af.mjs → chunk-vite-node-externalize.c843f497.mjs} +42 -24
- package/dist/{chunk-vite-node-utils.d8e5ff7b.mjs → chunk-vite-node-utils.b432150c.mjs} +1 -1
- package/dist/cli-wrapper.mjs +43 -26
- package/dist/cli.mjs +9 -10
- package/dist/config.d.ts +1 -1
- package/dist/entry.mjs +8 -7
- package/dist/{global-74489cc9.d.ts → global-fe52f84b.d.ts} +20 -6
- package/dist/{index-9eded9ec.d.ts → index-ea17aa0c.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +7 -6
- package/dist/loader.mjs +3 -3
- package/dist/node.d.ts +2 -2
- package/dist/node.mjs +11 -12
- package/dist/suite.mjs +6 -5
- package/dist/worker.mjs +9 -10
- package/package.json +5 -5
- package/dist/chunk-constants.d3f8437b.mjs +0 -38
- package/dist/vendor-picocolors.807856aa.mjs +0 -64
package/dist/browser.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { E as EnhancedSpy, q as Mock, r as MockContext, p as MockInstance, u as Mocked, v as MockedClass, n as MockedFunction, o as MockedObject, S as SpyInstance, h as afterAll, k as afterEach, g as beforeAll, j as beforeEach, m as createExpect, e as describe, l as expect, i as it, d as suite, t as test } from './index-
|
|
2
|
-
import { R as ResolvedConfig } from './global-
|
|
3
|
-
export { z as AfterSuiteRunMeta, A as ApiConfig, O as ArgumentsType, L as Arrayable, K as Awaitable,
|
|
1
|
+
export { E as EnhancedSpy, q as Mock, r as MockContext, p as MockInstance, u as Mocked, v as MockedClass, n as MockedFunction, o as MockedObject, S as SpyInstance, h as afterAll, k as afterEach, g as beforeAll, j as beforeEach, m as createExpect, e as describe, l as expect, i as it, d as suite, t as test } from './index-ea17aa0c.js';
|
|
2
|
+
import { R as ResolvedConfig } from './global-fe52f84b.js';
|
|
3
|
+
export { z as AfterSuiteRunMeta, A as ApiConfig, O as ArgumentsType, L as Arrayable, K as Awaitable, aa as BaseCoverageOptions, B as BuiltinEnvironment, Y as Constructable, ac as CoverageC8Options, ab as CoverageIstanbulOptions, a8 as CoverageOptions, a5 as CoverageProvider, a6 as CoverageProviderModule, a7 as CoverageReporter, Q as DeepMerge, D as DoneCallback, $ as Environment, E as EnvironmentOptions, _ as EnvironmentReturn, a3 as ErrorWithDiff, a as File, l as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, P as MergeInsertions, Z as ModuleCache, M as ModuleGraphData, X as MutableArray, N as Nullable, a4 as OnServerRestartHandler, a2 as ParsedStack, a1 as Position, b as Reporter, y as ResolveIdFunction, R as ResolvedConfig, a9 as ResolvedCoverageOptions, c as RunMode, p as RuntimeContext, r as SnapshotData, u as SnapshotMatchOptions, v as SnapshotResult, t as SnapshotStateOptions, x as SnapshotSummary, s as SnapshotUpdateState, S as Suite, k as SuiteAPI, n as SuiteCollector, o as SuiteFactory, m as SuiteHooks, h as Task, e as TaskBase, f as TaskResult, T as TaskResultPack, d as TaskState, g as Test, j as TestAPI, q as TestContext, i as TestFunction, w as UncheckedSnapshot, U as UserConfig, a0 as UserConsoleLog, V as Vitest, W as WorkerContext, G as WorkerGlobalState, C as WorkerRPC } from './global-fe52f84b.js';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
package/dist/browser.mjs
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
export { c as createExpect, d as describe, b as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.
|
|
2
|
-
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './chunk-runtime-hooks.
|
|
3
|
-
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-error.
|
|
1
|
+
export { c as createExpect, d as describe, b as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.be610650.mjs';
|
|
2
|
+
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './chunk-runtime-hooks.5d7073db.mjs';
|
|
3
|
+
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-error.1104e45a.mjs';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
|
7
7
|
import 'util';
|
|
8
|
-
import './chunk-mock-date.
|
|
8
|
+
import './chunk-mock-date.304e29b1.mjs';
|
|
9
9
|
import 'path';
|
|
10
|
-
import './
|
|
10
|
+
import './chunk-constants.71e8a211.mjs';
|
|
11
11
|
import 'tty';
|
|
12
|
+
import 'url';
|
|
12
13
|
import 'local-pkg';
|
|
13
14
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
14
|
-
import './chunk-runtime-rpc.
|
|
15
|
+
import './chunk-runtime-rpc.57586b73.mjs';
|
|
15
16
|
import './chunk-utils-global.fa20c2f6.mjs';
|
|
16
17
|
import './chunk-utils-timers.b48455ed.mjs';
|
|
17
18
|
import 'fs';
|
|
18
|
-
import './chunk-utils-source-map.
|
|
19
|
+
import './chunk-utils-source-map.bbf3ad19.mjs';
|
|
19
20
|
import './spy.mjs';
|
|
20
21
|
import 'tinyspy';
|
|
21
22
|
import './chunk-integrations-coverage.d205bd87.mjs';
|
|
@@ -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.cddda63d.mjs';
|
|
3
3
|
import require$$0$1 from 'stream';
|
|
4
4
|
import require$$0 from 'zlib';
|
|
5
5
|
import require$$3 from 'net';
|
|
@@ -9,19 +9,18 @@ import require$$2 from 'events';
|
|
|
9
9
|
import require$$1 from 'https';
|
|
10
10
|
import require$$2$1 from 'http';
|
|
11
11
|
import url from 'url';
|
|
12
|
-
import { A as API_PATH } from './chunk-constants.
|
|
13
|
-
import { j as interpretSourcePos, p as parseStacktrace } from './chunk-utils-source-map.
|
|
12
|
+
import { A as API_PATH } from './chunk-constants.71e8a211.mjs';
|
|
13
|
+
import { j as interpretSourcePos, p as parseStacktrace } from './chunk-utils-source-map.bbf3ad19.mjs';
|
|
14
14
|
import 'module';
|
|
15
15
|
import 'vm';
|
|
16
|
-
import './chunk-
|
|
16
|
+
import './chunk-vite-node-utils.b432150c.mjs';
|
|
17
17
|
import 'path';
|
|
18
|
-
import './vendor-picocolors.807856aa.mjs';
|
|
19
|
-
import 'tty';
|
|
20
|
-
import 'local-pkg';
|
|
21
|
-
import './chunk-vite-node-utils.d8e5ff7b.mjs';
|
|
22
18
|
import 'assert';
|
|
23
19
|
import 'util';
|
|
24
20
|
import 'debug';
|
|
21
|
+
import 'tty';
|
|
22
|
+
import './chunk-mock-date.304e29b1.mjs';
|
|
23
|
+
import 'local-pkg';
|
|
25
24
|
|
|
26
25
|
/*! (c) 2020 Andrea Giammarchi */
|
|
27
26
|
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import require$$0 from 'tty';
|
|
2
|
+
import url from 'url';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
var picocolors = {exports: {}};
|
|
6
|
+
|
|
7
|
+
let tty = require$$0;
|
|
8
|
+
|
|
9
|
+
let isColorSupported =
|
|
10
|
+
!("NO_COLOR" in process.env || process.argv.includes("--no-color")) &&
|
|
11
|
+
("FORCE_COLOR" in process.env ||
|
|
12
|
+
process.argv.includes("--color") ||
|
|
13
|
+
process.platform === "win32" ||
|
|
14
|
+
(tty.isatty(1) && process.env.TERM !== "dumb") ||
|
|
15
|
+
"CI" in process.env);
|
|
16
|
+
|
|
17
|
+
let formatter =
|
|
18
|
+
(open, close, replace = open) =>
|
|
19
|
+
input => {
|
|
20
|
+
let string = "" + input;
|
|
21
|
+
let index = string.indexOf(close, open.length);
|
|
22
|
+
return ~index
|
|
23
|
+
? open + replaceClose(string, close, replace, index) + close
|
|
24
|
+
: open + string + close
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
let replaceClose = (string, close, replace, index) => {
|
|
28
|
+
let start = string.substring(0, index) + replace;
|
|
29
|
+
let end = string.substring(index + close.length);
|
|
30
|
+
let nextIndex = end.indexOf(close);
|
|
31
|
+
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
let createColors = (enabled = isColorSupported) => ({
|
|
35
|
+
isColorSupported: enabled,
|
|
36
|
+
reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String,
|
|
37
|
+
bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String,
|
|
38
|
+
dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String,
|
|
39
|
+
italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String,
|
|
40
|
+
underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String,
|
|
41
|
+
inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String,
|
|
42
|
+
hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String,
|
|
43
|
+
strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String,
|
|
44
|
+
black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String,
|
|
45
|
+
red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String,
|
|
46
|
+
green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String,
|
|
47
|
+
yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String,
|
|
48
|
+
blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String,
|
|
49
|
+
magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String,
|
|
50
|
+
cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String,
|
|
51
|
+
white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String,
|
|
52
|
+
gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String,
|
|
53
|
+
bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String,
|
|
54
|
+
bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String,
|
|
55
|
+
bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String,
|
|
56
|
+
bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String,
|
|
57
|
+
bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String,
|
|
58
|
+
bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String,
|
|
59
|
+
bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String,
|
|
60
|
+
bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
picocolors.exports = createColors();
|
|
64
|
+
picocolors.exports.createColors = createColors;
|
|
65
|
+
|
|
66
|
+
function normalizeWindowsPath(input = "") {
|
|
67
|
+
if (!input.includes("\\")) {
|
|
68
|
+
return input;
|
|
69
|
+
}
|
|
70
|
+
return input.replace(/\\/g, "/");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const _UNC_REGEX = /^[/][/]/;
|
|
74
|
+
const _UNC_DRIVE_REGEX = /^[/][/]([.]{1,2}[/])?([a-zA-Z]):[/]/;
|
|
75
|
+
const _IS_ABSOLUTE_RE = /^\/|^\\|^[a-zA-Z]:[/\\]/;
|
|
76
|
+
const sep = "/";
|
|
77
|
+
const delimiter = ":";
|
|
78
|
+
const normalize = function(path2) {
|
|
79
|
+
if (path2.length === 0) {
|
|
80
|
+
return ".";
|
|
81
|
+
}
|
|
82
|
+
path2 = normalizeWindowsPath(path2);
|
|
83
|
+
const isUNCPath = path2.match(_UNC_REGEX);
|
|
84
|
+
const hasUNCDrive = isUNCPath && path2.match(_UNC_DRIVE_REGEX);
|
|
85
|
+
const isPathAbsolute = isAbsolute(path2);
|
|
86
|
+
const trailingSeparator = path2[path2.length - 1] === "/";
|
|
87
|
+
path2 = normalizeString(path2, !isPathAbsolute);
|
|
88
|
+
if (path2.length === 0) {
|
|
89
|
+
if (isPathAbsolute) {
|
|
90
|
+
return "/";
|
|
91
|
+
}
|
|
92
|
+
return trailingSeparator ? "./" : ".";
|
|
93
|
+
}
|
|
94
|
+
if (trailingSeparator) {
|
|
95
|
+
path2 += "/";
|
|
96
|
+
}
|
|
97
|
+
if (isUNCPath) {
|
|
98
|
+
if (hasUNCDrive) {
|
|
99
|
+
return `//./${path2}`;
|
|
100
|
+
}
|
|
101
|
+
return `//${path2}`;
|
|
102
|
+
}
|
|
103
|
+
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
104
|
+
};
|
|
105
|
+
const join = function(...args) {
|
|
106
|
+
if (args.length === 0) {
|
|
107
|
+
return ".";
|
|
108
|
+
}
|
|
109
|
+
let joined;
|
|
110
|
+
for (let i = 0; i < args.length; ++i) {
|
|
111
|
+
const arg = args[i];
|
|
112
|
+
if (arg.length > 0) {
|
|
113
|
+
if (joined === void 0) {
|
|
114
|
+
joined = arg;
|
|
115
|
+
} else {
|
|
116
|
+
joined += `/${arg}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (joined === void 0) {
|
|
121
|
+
return ".";
|
|
122
|
+
}
|
|
123
|
+
return normalize(joined);
|
|
124
|
+
};
|
|
125
|
+
const resolve = function(...args) {
|
|
126
|
+
args = args.map((arg) => normalizeWindowsPath(arg));
|
|
127
|
+
let resolvedPath = "";
|
|
128
|
+
let resolvedAbsolute = false;
|
|
129
|
+
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
130
|
+
const path2 = i >= 0 ? args[i] : process.cwd();
|
|
131
|
+
if (path2.length === 0) {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
resolvedPath = `${path2}/${resolvedPath}`;
|
|
135
|
+
resolvedAbsolute = isAbsolute(path2);
|
|
136
|
+
}
|
|
137
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
138
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
139
|
+
return `/${resolvedPath}`;
|
|
140
|
+
}
|
|
141
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
142
|
+
};
|
|
143
|
+
function normalizeString(path2, allowAboveRoot) {
|
|
144
|
+
let res = "";
|
|
145
|
+
let lastSegmentLength = 0;
|
|
146
|
+
let lastSlash = -1;
|
|
147
|
+
let dots = 0;
|
|
148
|
+
let char = null;
|
|
149
|
+
for (let i = 0; i <= path2.length; ++i) {
|
|
150
|
+
if (i < path2.length) {
|
|
151
|
+
char = path2[i];
|
|
152
|
+
} else if (char === "/") {
|
|
153
|
+
break;
|
|
154
|
+
} else {
|
|
155
|
+
char = "/";
|
|
156
|
+
}
|
|
157
|
+
if (char === "/") {
|
|
158
|
+
if (lastSlash === i - 1 || dots === 1) ; else if (dots === 2) {
|
|
159
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
160
|
+
if (res.length > 2) {
|
|
161
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
162
|
+
if (lastSlashIndex === -1) {
|
|
163
|
+
res = "";
|
|
164
|
+
lastSegmentLength = 0;
|
|
165
|
+
} else {
|
|
166
|
+
res = res.slice(0, lastSlashIndex);
|
|
167
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
168
|
+
}
|
|
169
|
+
lastSlash = i;
|
|
170
|
+
dots = 0;
|
|
171
|
+
continue;
|
|
172
|
+
} else if (res.length !== 0) {
|
|
173
|
+
res = "";
|
|
174
|
+
lastSegmentLength = 0;
|
|
175
|
+
lastSlash = i;
|
|
176
|
+
dots = 0;
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (allowAboveRoot) {
|
|
181
|
+
res += res.length > 0 ? "/.." : "..";
|
|
182
|
+
lastSegmentLength = 2;
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
if (res.length > 0) {
|
|
186
|
+
res += `/${path2.slice(lastSlash + 1, i)}`;
|
|
187
|
+
} else {
|
|
188
|
+
res = path2.slice(lastSlash + 1, i);
|
|
189
|
+
}
|
|
190
|
+
lastSegmentLength = i - lastSlash - 1;
|
|
191
|
+
}
|
|
192
|
+
lastSlash = i;
|
|
193
|
+
dots = 0;
|
|
194
|
+
} else if (char === "." && dots !== -1) {
|
|
195
|
+
++dots;
|
|
196
|
+
} else {
|
|
197
|
+
dots = -1;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return res;
|
|
201
|
+
}
|
|
202
|
+
const isAbsolute = function(p) {
|
|
203
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
204
|
+
};
|
|
205
|
+
const toNamespacedPath = function(p) {
|
|
206
|
+
return normalizeWindowsPath(p);
|
|
207
|
+
};
|
|
208
|
+
const extname = function(p) {
|
|
209
|
+
return path.posix.extname(normalizeWindowsPath(p));
|
|
210
|
+
};
|
|
211
|
+
const relative = function(from, to) {
|
|
212
|
+
return path.posix.relative(normalizeWindowsPath(from), normalizeWindowsPath(to));
|
|
213
|
+
};
|
|
214
|
+
const dirname = function(p) {
|
|
215
|
+
return path.posix.dirname(normalizeWindowsPath(p));
|
|
216
|
+
};
|
|
217
|
+
const format = function(p) {
|
|
218
|
+
return normalizeWindowsPath(path.posix.format(p));
|
|
219
|
+
};
|
|
220
|
+
const basename = function(p, ext) {
|
|
221
|
+
return path.posix.basename(normalizeWindowsPath(p), ext);
|
|
222
|
+
};
|
|
223
|
+
const parse = function(p) {
|
|
224
|
+
return path.posix.parse(normalizeWindowsPath(p));
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const _path = /*#__PURE__*/Object.freeze({
|
|
228
|
+
__proto__: null,
|
|
229
|
+
sep: sep,
|
|
230
|
+
delimiter: delimiter,
|
|
231
|
+
normalize: normalize,
|
|
232
|
+
join: join,
|
|
233
|
+
resolve: resolve,
|
|
234
|
+
normalizeString: normalizeString,
|
|
235
|
+
isAbsolute: isAbsolute,
|
|
236
|
+
toNamespacedPath: toNamespacedPath,
|
|
237
|
+
extname: extname,
|
|
238
|
+
relative: relative,
|
|
239
|
+
dirname: dirname,
|
|
240
|
+
format: format,
|
|
241
|
+
basename: basename,
|
|
242
|
+
parse: parse
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
({
|
|
246
|
+
..._path
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
const rootDir = resolve(url.fileURLToPath(import.meta.url), "../../");
|
|
250
|
+
const distDir = resolve(url.fileURLToPath(import.meta.url), "../../dist");
|
|
251
|
+
const defaultPort = 51204;
|
|
252
|
+
const EXIT_CODE_RESTART = 43;
|
|
253
|
+
const API_PATH = "/__vitest_api__";
|
|
254
|
+
const configFiles = [
|
|
255
|
+
"vitest.config.ts",
|
|
256
|
+
"vitest.config.mts",
|
|
257
|
+
"vitest.config.cts",
|
|
258
|
+
"vitest.config.js",
|
|
259
|
+
"vitest.config.mjs",
|
|
260
|
+
"vitest.config.cjs",
|
|
261
|
+
"vite.config.ts",
|
|
262
|
+
"vite.config.mts",
|
|
263
|
+
"vite.config.cts",
|
|
264
|
+
"vite.config.js",
|
|
265
|
+
"vite.config.mjs",
|
|
266
|
+
"vite.config.cjs"
|
|
267
|
+
];
|
|
268
|
+
const globalApis = [
|
|
269
|
+
"suite",
|
|
270
|
+
"test",
|
|
271
|
+
"describe",
|
|
272
|
+
"it",
|
|
273
|
+
"chai",
|
|
274
|
+
"expect",
|
|
275
|
+
"assert",
|
|
276
|
+
"vitest",
|
|
277
|
+
"vi",
|
|
278
|
+
"beforeAll",
|
|
279
|
+
"afterAll",
|
|
280
|
+
"beforeEach",
|
|
281
|
+
"afterEach"
|
|
282
|
+
];
|
|
283
|
+
|
|
284
|
+
export { API_PATH as A, EXIT_CODE_RESTART as E, resolve as a, basename as b, distDir as c, dirname as d, rootDir as e, configFiles as f, defaultPort as g, extname as h, isAbsolute as i, join as j, globalApis as k, normalize as n, picocolors as p, relative as r, toNamespacedPath as t };
|
package/dist/{chunk-integrations-globals.e81d2091.mjs → chunk-integrations-globals.60af7da3.mjs}
RENAMED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as index } from './chunk-runtime-hooks.
|
|
1
|
+
import { k as globalApis } from './chunk-constants.71e8a211.mjs';
|
|
2
|
+
import { i as index } from './chunk-runtime-hooks.5d7073db.mjs';
|
|
3
|
+
import 'tty';
|
|
3
4
|
import 'url';
|
|
4
|
-
import './chunk-mock-date.debe9954.mjs';
|
|
5
5
|
import 'path';
|
|
6
|
-
import './
|
|
7
|
-
import 'tty';
|
|
8
|
-
import 'local-pkg';
|
|
9
|
-
import './chunk-runtime-chain.6e363ba2.mjs';
|
|
6
|
+
import './chunk-runtime-chain.be610650.mjs';
|
|
10
7
|
import 'util';
|
|
8
|
+
import './chunk-mock-date.304e29b1.mjs';
|
|
9
|
+
import 'local-pkg';
|
|
11
10
|
import 'chai';
|
|
12
11
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
13
|
-
import './chunk-runtime-rpc.
|
|
12
|
+
import './chunk-runtime-rpc.57586b73.mjs';
|
|
14
13
|
import './chunk-utils-global.fa20c2f6.mjs';
|
|
15
14
|
import './chunk-utils-timers.b48455ed.mjs';
|
|
16
15
|
import 'fs';
|
|
17
|
-
import './chunk-utils-source-map.
|
|
16
|
+
import './chunk-utils-source-map.bbf3ad19.mjs';
|
|
18
17
|
import './spy.mjs';
|
|
19
18
|
import 'tinyspy';
|
|
20
19
|
|
|
@@ -1,190 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { p as picocolors } from './
|
|
1
|
+
import { relative } from 'path';
|
|
2
|
+
import { r as relative$1, p as picocolors, E as EXIT_CODE_RESTART } from './chunk-constants.71e8a211.mjs';
|
|
3
3
|
import { isPackageExists } from 'local-pkg';
|
|
4
4
|
|
|
5
|
-
function normalizeWindowsPath(input = "") {
|
|
6
|
-
if (!input.includes("\\")) {
|
|
7
|
-
return input;
|
|
8
|
-
}
|
|
9
|
-
return input.replace(/\\/g, "/");
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const _UNC_REGEX = /^[/][/]/;
|
|
13
|
-
const _UNC_DRIVE_REGEX = /^[/][/]([.]{1,2}[/])?([a-zA-Z]):[/]/;
|
|
14
|
-
const _IS_ABSOLUTE_RE = /^\/|^\\|^[a-zA-Z]:[/\\]/;
|
|
15
|
-
const sep = "/";
|
|
16
|
-
const delimiter = ":";
|
|
17
|
-
const normalize = function(path2) {
|
|
18
|
-
if (path2.length === 0) {
|
|
19
|
-
return ".";
|
|
20
|
-
}
|
|
21
|
-
path2 = normalizeWindowsPath(path2);
|
|
22
|
-
const isUNCPath = path2.match(_UNC_REGEX);
|
|
23
|
-
const hasUNCDrive = isUNCPath && path2.match(_UNC_DRIVE_REGEX);
|
|
24
|
-
const isPathAbsolute = isAbsolute(path2);
|
|
25
|
-
const trailingSeparator = path2[path2.length - 1] === "/";
|
|
26
|
-
path2 = normalizeString(path2, !isPathAbsolute);
|
|
27
|
-
if (path2.length === 0) {
|
|
28
|
-
if (isPathAbsolute) {
|
|
29
|
-
return "/";
|
|
30
|
-
}
|
|
31
|
-
return trailingSeparator ? "./" : ".";
|
|
32
|
-
}
|
|
33
|
-
if (trailingSeparator) {
|
|
34
|
-
path2 += "/";
|
|
35
|
-
}
|
|
36
|
-
if (isUNCPath) {
|
|
37
|
-
if (hasUNCDrive) {
|
|
38
|
-
return `//./${path2}`;
|
|
39
|
-
}
|
|
40
|
-
return `//${path2}`;
|
|
41
|
-
}
|
|
42
|
-
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
43
|
-
};
|
|
44
|
-
const join = function(...args) {
|
|
45
|
-
if (args.length === 0) {
|
|
46
|
-
return ".";
|
|
47
|
-
}
|
|
48
|
-
let joined;
|
|
49
|
-
for (let i = 0; i < args.length; ++i) {
|
|
50
|
-
const arg = args[i];
|
|
51
|
-
if (arg.length > 0) {
|
|
52
|
-
if (joined === void 0) {
|
|
53
|
-
joined = arg;
|
|
54
|
-
} else {
|
|
55
|
-
joined += `/${arg}`;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (joined === void 0) {
|
|
60
|
-
return ".";
|
|
61
|
-
}
|
|
62
|
-
return normalize(joined);
|
|
63
|
-
};
|
|
64
|
-
const resolve = function(...args) {
|
|
65
|
-
args = args.map((arg) => normalizeWindowsPath(arg));
|
|
66
|
-
let resolvedPath = "";
|
|
67
|
-
let resolvedAbsolute = false;
|
|
68
|
-
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
69
|
-
const path2 = i >= 0 ? args[i] : process.cwd();
|
|
70
|
-
if (path2.length === 0) {
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
resolvedPath = `${path2}/${resolvedPath}`;
|
|
74
|
-
resolvedAbsolute = isAbsolute(path2);
|
|
75
|
-
}
|
|
76
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
77
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
78
|
-
return `/${resolvedPath}`;
|
|
79
|
-
}
|
|
80
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
81
|
-
};
|
|
82
|
-
function normalizeString(path2, allowAboveRoot) {
|
|
83
|
-
let res = "";
|
|
84
|
-
let lastSegmentLength = 0;
|
|
85
|
-
let lastSlash = -1;
|
|
86
|
-
let dots = 0;
|
|
87
|
-
let char = null;
|
|
88
|
-
for (let i = 0; i <= path2.length; ++i) {
|
|
89
|
-
if (i < path2.length) {
|
|
90
|
-
char = path2[i];
|
|
91
|
-
} else if (char === "/") {
|
|
92
|
-
break;
|
|
93
|
-
} else {
|
|
94
|
-
char = "/";
|
|
95
|
-
}
|
|
96
|
-
if (char === "/") {
|
|
97
|
-
if (lastSlash === i - 1 || dots === 1) ; else if (dots === 2) {
|
|
98
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
99
|
-
if (res.length > 2) {
|
|
100
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
101
|
-
if (lastSlashIndex === -1) {
|
|
102
|
-
res = "";
|
|
103
|
-
lastSegmentLength = 0;
|
|
104
|
-
} else {
|
|
105
|
-
res = res.slice(0, lastSlashIndex);
|
|
106
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
107
|
-
}
|
|
108
|
-
lastSlash = i;
|
|
109
|
-
dots = 0;
|
|
110
|
-
continue;
|
|
111
|
-
} else if (res.length !== 0) {
|
|
112
|
-
res = "";
|
|
113
|
-
lastSegmentLength = 0;
|
|
114
|
-
lastSlash = i;
|
|
115
|
-
dots = 0;
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
if (allowAboveRoot) {
|
|
120
|
-
res += res.length > 0 ? "/.." : "..";
|
|
121
|
-
lastSegmentLength = 2;
|
|
122
|
-
}
|
|
123
|
-
} else {
|
|
124
|
-
if (res.length > 0) {
|
|
125
|
-
res += `/${path2.slice(lastSlash + 1, i)}`;
|
|
126
|
-
} else {
|
|
127
|
-
res = path2.slice(lastSlash + 1, i);
|
|
128
|
-
}
|
|
129
|
-
lastSegmentLength = i - lastSlash - 1;
|
|
130
|
-
}
|
|
131
|
-
lastSlash = i;
|
|
132
|
-
dots = 0;
|
|
133
|
-
} else if (char === "." && dots !== -1) {
|
|
134
|
-
++dots;
|
|
135
|
-
} else {
|
|
136
|
-
dots = -1;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return res;
|
|
140
|
-
}
|
|
141
|
-
const isAbsolute = function(p) {
|
|
142
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
143
|
-
};
|
|
144
|
-
const toNamespacedPath = function(p) {
|
|
145
|
-
return normalizeWindowsPath(p);
|
|
146
|
-
};
|
|
147
|
-
const extname = function(p) {
|
|
148
|
-
return path.posix.extname(normalizeWindowsPath(p));
|
|
149
|
-
};
|
|
150
|
-
const relative = function(from, to) {
|
|
151
|
-
return path.posix.relative(normalizeWindowsPath(from), normalizeWindowsPath(to));
|
|
152
|
-
};
|
|
153
|
-
const dirname = function(p) {
|
|
154
|
-
return path.posix.dirname(normalizeWindowsPath(p));
|
|
155
|
-
};
|
|
156
|
-
const format = function(p) {
|
|
157
|
-
return normalizeWindowsPath(path.posix.format(p));
|
|
158
|
-
};
|
|
159
|
-
const basename = function(p, ext) {
|
|
160
|
-
return path.posix.basename(normalizeWindowsPath(p), ext);
|
|
161
|
-
};
|
|
162
|
-
const parse = function(p) {
|
|
163
|
-
return path.posix.parse(normalizeWindowsPath(p));
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
const _path = /*#__PURE__*/Object.freeze({
|
|
167
|
-
__proto__: null,
|
|
168
|
-
sep: sep,
|
|
169
|
-
delimiter: delimiter,
|
|
170
|
-
normalize: normalize,
|
|
171
|
-
join: join,
|
|
172
|
-
resolve: resolve,
|
|
173
|
-
normalizeString: normalizeString,
|
|
174
|
-
isAbsolute: isAbsolute,
|
|
175
|
-
toNamespacedPath: toNamespacedPath,
|
|
176
|
-
extname: extname,
|
|
177
|
-
relative: relative,
|
|
178
|
-
dirname: dirname,
|
|
179
|
-
format: format,
|
|
180
|
-
basename: basename,
|
|
181
|
-
parse: parse
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
({
|
|
185
|
-
..._path
|
|
186
|
-
});
|
|
187
|
-
|
|
188
5
|
const RealDate = Date;
|
|
189
6
|
let now = null;
|
|
190
7
|
class MockDate extends RealDate {
|
|
@@ -398,7 +215,7 @@ var _a;
|
|
|
398
215
|
const isNode = typeof process < "u" && typeof process.stdout < "u" && !((_a = process.versions) == null ? void 0 : _a.deno) && !globalThis.window;
|
|
399
216
|
const isBrowser = typeof window !== "undefined";
|
|
400
217
|
const isWindows = isNode && process.platform === "win32";
|
|
401
|
-
const relativePath = isBrowser ? relative
|
|
218
|
+
const relativePath = isBrowser ? relative : relative$1;
|
|
402
219
|
function partitionSuiteChildren(suite) {
|
|
403
220
|
let tasksGroup = [];
|
|
404
221
|
const tasksGroups = [];
|
|
@@ -450,7 +267,7 @@ async function ensurePackageInstalled(dependency, root) {
|
|
|
450
267
|
process.stderr.write(picocolors.exports.yellow(`
|
|
451
268
|
Package ${dependency} installed, re-run the command to start.
|
|
452
269
|
`));
|
|
453
|
-
process.exit(
|
|
270
|
+
process.exit(EXIT_CODE_RESTART);
|
|
454
271
|
return true;
|
|
455
272
|
}
|
|
456
273
|
return false;
|
|
@@ -483,7 +300,7 @@ function getCallLastIndex(code) {
|
|
|
483
300
|
}
|
|
484
301
|
return null;
|
|
485
302
|
}
|
|
486
|
-
isNode ? relative : relative
|
|
303
|
+
isNode ? relative$1 : relative;
|
|
487
304
|
class AggregateErrorPonyfill extends Error {
|
|
488
305
|
constructor(errors, message = "") {
|
|
489
306
|
super(message);
|
|
@@ -491,4 +308,4 @@ class AggregateErrorPonyfill extends Error {
|
|
|
491
308
|
}
|
|
492
309
|
}
|
|
493
310
|
|
|
494
|
-
export { AggregateErrorPonyfill as A,
|
|
311
|
+
export { AggregateErrorPonyfill as A, stdout as B, isWindows as C, mergeSlashes as D, getAllMockableProperties as E, RealDate as R, resetModules as a, getNames as b, assertTypes as c, getFullName as d, notNullish as e, deepClone as f, getCallLastIndex as g, getType as h, isObject as i, isNode as j, relativePath as k, isBrowser as l, mockDate as m, noop as n, shuffle as o, partitionSuiteChildren as p, hasTests as q, resetDate as r, slash as s, toArray as t, hasFailed as u, getTests as v, hasFailedSnapshot as w, getSuites as x, deepMerge as y, ensurePackageInstalled as z };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as resolve } from './chunk-constants.71e8a211.mjs';
|
|
2
2
|
import { e as execa } from './vendor-index.fbec8a81.mjs';
|
|
3
|
-
import 'path';
|
|
4
|
-
import './vendor-picocolors.807856aa.mjs';
|
|
5
3
|
import 'tty';
|
|
6
|
-
import '
|
|
4
|
+
import 'url';
|
|
5
|
+
import 'path';
|
|
7
6
|
import 'buffer';
|
|
8
7
|
import 'child_process';
|
|
9
8
|
import 'process';
|
|
@@ -12,7 +11,6 @@ import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
|
12
11
|
import 'fs';
|
|
13
12
|
import 'stream';
|
|
14
13
|
import 'util';
|
|
15
|
-
import 'url';
|
|
16
14
|
import 'os';
|
|
17
15
|
import './vendor-index.29636037.mjs';
|
|
18
16
|
import 'assert';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import util$1 from 'util';
|
|
2
|
-
import { i as isObject,
|
|
2
|
+
import { i as isObject, g as getCallLastIndex, s as slash, b as getNames, c as assertTypes, d as getFullName, n as noop } from './chunk-mock-date.304e29b1.mjs';
|
|
3
3
|
import * as chai$2 from 'chai';
|
|
4
4
|
import { expect, AssertionError, util } from 'chai';
|
|
5
5
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
6
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.57586b73.mjs';
|
|
7
7
|
import fs, { promises } from 'fs';
|
|
8
|
-
import {
|
|
8
|
+
import { j as join, d as dirname, p as picocolors } from './chunk-constants.71e8a211.mjs';
|
|
9
|
+
import { a as plugins_1, f as format_1, g as getOriginalPos, b as posToNumber, n as numberToPos, l as lineSplitRE, p as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils } from './chunk-utils-source-map.bbf3ad19.mjs';
|
|
9
10
|
import { g as getWorkerState } from './chunk-utils-global.fa20c2f6.mjs';
|
|
10
|
-
import { p as picocolors } from './vendor-picocolors.807856aa.mjs';
|
|
11
11
|
import { isMockFunction } from './spy.mjs';
|
|
12
12
|
import { s as safeSetTimeout, a as safeClearTimeout } from './chunk-utils-timers.b48455ed.mjs';
|
|
13
13
|
|