vitest 0.12.9 → 0.13.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/{chunk-api-setup.010a6158.js → chunk-api-setup.8d604f90.js} +107 -51
- package/dist/{chunk-constants.9e9c5c75.js → chunk-constants.b0ea3b74.js} +1 -1
- package/dist/{chunk-defaults.0fce304d.js → chunk-defaults.e5ec89dd.js} +1 -1
- package/dist/{chunk-install-pkg.73b84ae1.js → chunk-install-pkg.e11db438.js} +1 -1
- package/dist/{chunk-integrations-globals.fda74a73.js → chunk-integrations-globals.1cc5e231.js} +7 -7
- package/dist/{chunk-runtime-chain.67ecb3a0.js → chunk-runtime-chain.46442ffe.js} +21 -10
- package/dist/{chunk-runtime-mocker.f99f69c3.js → chunk-runtime-mocker.e9fdf718.js} +3 -3
- package/dist/chunk-runtime-rpc.50765c8b.js +15 -0
- package/dist/{chunk-utils-global.2529a727.js → chunk-utils-global.550519fc.js} +28 -2
- package/dist/{chunk-utils-timers.b1b3dfa6.js → chunk-utils-source-map.19e9554e.js} +14 -11
- package/dist/{chunk-vite-node-externalize.42b0363f.js → chunk-vite-node-externalize.61cc47ef.js} +8761 -8770
- package/dist/{chunk-vite-node-utils.317f59c6.js → chunk-vite-node-utils.52235551.js} +4 -4
- package/dist/cli.js +17 -17
- package/dist/entry.js +6 -6
- package/dist/index.d.ts +61 -10
- package/dist/index.js +4 -4
- package/dist/node.d.ts +56 -0
- package/dist/node.js +20 -20
- package/dist/{vendor-entry.e4d01a65.js → vendor-entry.225630f2.js} +12 -12
- package/dist/{vendor-index.40be925a.js → vendor-index.22581bd4.js} +407 -407
- package/dist/worker.js +5 -5
- package/package.json +37 -37
- package/dist/chunk-runtime-rpc.5050afd6.js +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import { c as createBirpc } from './chunk-vite-node-utils.
|
|
2
|
+
import { c as createBirpc } from './chunk-vite-node-utils.52235551.js';
|
|
3
3
|
import require$$0$1 from 'stream';
|
|
4
4
|
import require$$0 from 'zlib';
|
|
5
5
|
import require$$3 from 'net';
|
|
@@ -9,11 +9,11 @@ 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 {
|
|
12
|
+
import { A as API_PATH } from './chunk-constants.b0ea3b74.js';
|
|
13
|
+
import { j as interpretSourcePos, b as parseStacktrace } from './chunk-utils-source-map.19e9554e.js';
|
|
14
14
|
import 'module';
|
|
15
15
|
import 'vm';
|
|
16
|
-
import './chunk-utils-global.
|
|
16
|
+
import './chunk-utils-global.550519fc.js';
|
|
17
17
|
import 'tty';
|
|
18
18
|
import 'local-pkg';
|
|
19
19
|
import 'path';
|
|
@@ -3268,6 +3268,7 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3268
3268
|
|
|
3269
3269
|
if (opts.followRedirects) {
|
|
3270
3270
|
if (websocket._redirects === 0) {
|
|
3271
|
+
websocket._originalSecure = isSecure;
|
|
3271
3272
|
websocket._originalHost = parsedUrl.host;
|
|
3272
3273
|
|
|
3273
3274
|
const headers = options && options.headers;
|
|
@@ -3283,18 +3284,21 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3283
3284
|
options.headers[key.toLowerCase()] = value;
|
|
3284
3285
|
}
|
|
3285
3286
|
}
|
|
3286
|
-
} else if (
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3287
|
+
} else if (websocket.listenerCount('redirect') === 0) {
|
|
3288
|
+
const isSameHost = parsedUrl.host === websocket._originalHost;
|
|
3289
|
+
|
|
3290
|
+
if (!isSameHost || (websocket._originalSecure && !isSecure)) {
|
|
3291
|
+
//
|
|
3292
|
+
// Match curl 7.77.0 behavior and drop the following headers. These
|
|
3293
|
+
// headers are also dropped when following a redirect to a subdomain.
|
|
3294
|
+
//
|
|
3295
|
+
delete opts.headers.authorization;
|
|
3296
|
+
delete opts.headers.cookie;
|
|
3297
|
+
|
|
3298
|
+
if (!isSameHost) delete opts.headers.host;
|
|
3299
|
+
|
|
3300
|
+
opts.auth = undefined;
|
|
3301
|
+
}
|
|
3298
3302
|
}
|
|
3299
3303
|
|
|
3300
3304
|
//
|
|
@@ -3386,6 +3390,11 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3386
3390
|
|
|
3387
3391
|
req = websocket._req = null;
|
|
3388
3392
|
|
|
3393
|
+
if (res.headers.upgrade.toLowerCase() !== 'websocket') {
|
|
3394
|
+
abortHandshake$1(websocket, socket, 'Invalid Upgrade header');
|
|
3395
|
+
return;
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3389
3398
|
const digest = createHash$1('sha1')
|
|
3390
3399
|
.update(key + GUID$1)
|
|
3391
3400
|
.digest('base64');
|
|
@@ -4071,21 +4080,36 @@ class WebSocketServer extends EventEmitter {
|
|
|
4071
4080
|
handleUpgrade(req, socket, head, cb) {
|
|
4072
4081
|
socket.on('error', socketOnError);
|
|
4073
4082
|
|
|
4074
|
-
const key =
|
|
4075
|
-
req.headers['sec-websocket-key'] !== undefined
|
|
4076
|
-
? req.headers['sec-websocket-key']
|
|
4077
|
-
: false;
|
|
4083
|
+
const key = req.headers['sec-websocket-key'];
|
|
4078
4084
|
const version = +req.headers['sec-websocket-version'];
|
|
4079
4085
|
|
|
4080
|
-
if (
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4086
|
+
if (req.method !== 'GET') {
|
|
4087
|
+
const message = 'Invalid HTTP method';
|
|
4088
|
+
abortHandshakeOrEmitwsClientError(this, req, socket, 405, message);
|
|
4089
|
+
return;
|
|
4090
|
+
}
|
|
4091
|
+
|
|
4092
|
+
if (req.headers.upgrade.toLowerCase() !== 'websocket') {
|
|
4093
|
+
const message = 'Invalid Upgrade header';
|
|
4094
|
+
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
|
|
4095
|
+
return;
|
|
4096
|
+
}
|
|
4097
|
+
|
|
4098
|
+
if (!key || !keyRegex.test(key)) {
|
|
4099
|
+
const message = 'Missing or invalid Sec-WebSocket-Key header';
|
|
4100
|
+
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
|
|
4101
|
+
return;
|
|
4102
|
+
}
|
|
4103
|
+
|
|
4104
|
+
if (version !== 8 && version !== 13) {
|
|
4105
|
+
const message = 'Missing or invalid Sec-WebSocket-Version header';
|
|
4106
|
+
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
|
|
4107
|
+
return;
|
|
4108
|
+
}
|
|
4109
|
+
|
|
4110
|
+
if (!this.shouldHandle(req)) {
|
|
4111
|
+
abortHandshake(socket, 400);
|
|
4112
|
+
return;
|
|
4089
4113
|
}
|
|
4090
4114
|
|
|
4091
4115
|
const secWebSocketProtocol = req.headers['sec-websocket-protocol'];
|
|
@@ -4095,7 +4119,9 @@ class WebSocketServer extends EventEmitter {
|
|
|
4095
4119
|
try {
|
|
4096
4120
|
protocols = subprotocol.parse(secWebSocketProtocol);
|
|
4097
4121
|
} catch (err) {
|
|
4098
|
-
|
|
4122
|
+
const message = 'Invalid Sec-WebSocket-Protocol header';
|
|
4123
|
+
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
|
|
4124
|
+
return;
|
|
4099
4125
|
}
|
|
4100
4126
|
}
|
|
4101
4127
|
|
|
@@ -4120,7 +4146,10 @@ class WebSocketServer extends EventEmitter {
|
|
|
4120
4146
|
extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
|
|
4121
4147
|
}
|
|
4122
4148
|
} catch (err) {
|
|
4123
|
-
|
|
4149
|
+
const message =
|
|
4150
|
+
'Invalid or unacceptable Sec-WebSocket-Extensions header';
|
|
4151
|
+
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
|
|
4152
|
+
return;
|
|
4124
4153
|
}
|
|
4125
4154
|
}
|
|
4126
4155
|
|
|
@@ -4287,7 +4316,7 @@ function emitClose(server) {
|
|
|
4287
4316
|
}
|
|
4288
4317
|
|
|
4289
4318
|
/**
|
|
4290
|
-
* Handle
|
|
4319
|
+
* Handle socket errors.
|
|
4291
4320
|
*
|
|
4292
4321
|
* @private
|
|
4293
4322
|
*/
|
|
@@ -4305,27 +4334,54 @@ function socketOnError() {
|
|
|
4305
4334
|
* @private
|
|
4306
4335
|
*/
|
|
4307
4336
|
function abortHandshake(socket, code, message, headers) {
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4337
|
+
//
|
|
4338
|
+
// The socket is writable unless the user destroyed or ended it before calling
|
|
4339
|
+
// `server.handleUpgrade()` or in the `verifyClient` function, which is a user
|
|
4340
|
+
// error. Handling this does not make much sense as the worst that can happen
|
|
4341
|
+
// is that some of the data written by the user might be discarded due to the
|
|
4342
|
+
// call to `socket.end()` below, which triggers an `'error'` event that in
|
|
4343
|
+
// turn causes the socket to be destroyed.
|
|
4344
|
+
//
|
|
4345
|
+
message = message || http.STATUS_CODES[code];
|
|
4346
|
+
headers = {
|
|
4347
|
+
Connection: 'close',
|
|
4348
|
+
'Content-Type': 'text/html',
|
|
4349
|
+
'Content-Length': Buffer.byteLength(message),
|
|
4350
|
+
...headers
|
|
4351
|
+
};
|
|
4316
4352
|
|
|
4317
|
-
|
|
4318
|
-
`HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` +
|
|
4319
|
-
Object.keys(headers)
|
|
4320
|
-
.map((h) => `${h}: ${headers[h]}`)
|
|
4321
|
-
.join('\r\n') +
|
|
4322
|
-
'\r\n\r\n' +
|
|
4323
|
-
message
|
|
4324
|
-
);
|
|
4325
|
-
}
|
|
4353
|
+
socket.once('finish', socket.destroy);
|
|
4326
4354
|
|
|
4327
|
-
socket.
|
|
4328
|
-
|
|
4355
|
+
socket.end(
|
|
4356
|
+
`HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` +
|
|
4357
|
+
Object.keys(headers)
|
|
4358
|
+
.map((h) => `${h}: ${headers[h]}`)
|
|
4359
|
+
.join('\r\n') +
|
|
4360
|
+
'\r\n\r\n' +
|
|
4361
|
+
message
|
|
4362
|
+
);
|
|
4363
|
+
}
|
|
4364
|
+
|
|
4365
|
+
/**
|
|
4366
|
+
* Emit a `'wsClientError'` event on a `WebSocketServer` if there is at least
|
|
4367
|
+
* one listener for it, otherwise call `abortHandshake()`.
|
|
4368
|
+
*
|
|
4369
|
+
* @param {WebSocketServer} server The WebSocket server
|
|
4370
|
+
* @param {http.IncomingMessage} req The request object
|
|
4371
|
+
* @param {(net.Socket|tls.Socket)} socket The socket of the upgrade request
|
|
4372
|
+
* @param {Number} code The HTTP response status code
|
|
4373
|
+
* @param {String} message The HTTP response body
|
|
4374
|
+
* @private
|
|
4375
|
+
*/
|
|
4376
|
+
function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
|
|
4377
|
+
if (server.listenerCount('wsClientError')) {
|
|
4378
|
+
const err = new Error(message);
|
|
4379
|
+
Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);
|
|
4380
|
+
|
|
4381
|
+
server.emit('wsClientError', err, socket, req);
|
|
4382
|
+
} else {
|
|
4383
|
+
abortHandshake(socket, code, message);
|
|
4384
|
+
}
|
|
4329
4385
|
}
|
|
4330
4386
|
|
|
4331
4387
|
function setup(ctx) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from 'url';
|
|
2
|
-
import {
|
|
2
|
+
import { l as resolve } from './chunk-utils-global.550519fc.js';
|
|
3
3
|
|
|
4
4
|
const distDir = resolve(fileURLToPath(import.meta.url), "../../dist");
|
|
5
5
|
const defaultPort = 51204;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, promises } from 'fs';
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import { pathToFileURL } from 'url';
|
|
4
|
-
import { t as toArray,
|
|
4
|
+
import { t as toArray, l as resolve } from './chunk-utils-global.550519fc.js';
|
|
5
5
|
|
|
6
6
|
const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
|
|
7
7
|
const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**"];
|
|
@@ -2,7 +2,7 @@ import path$2 from 'path';
|
|
|
2
2
|
import fs$2 from 'fs';
|
|
3
3
|
import require$$0 from 'util';
|
|
4
4
|
import childProcess$1 from 'child_process';
|
|
5
|
-
import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1, o as onetime$1 } from './vendor-index.
|
|
5
|
+
import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1, o as onetime$1 } from './vendor-index.22581bd4.js';
|
|
6
6
|
import require$$0$1 from 'os';
|
|
7
7
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
8
8
|
import 'assert';
|
package/dist/{chunk-integrations-globals.fda74a73.js → chunk-integrations-globals.1cc5e231.js}
RENAMED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { g as globalApis } from './chunk-constants.
|
|
2
|
-
import { i as index } from './vendor-entry.
|
|
1
|
+
import { g as globalApis } from './chunk-constants.b0ea3b74.js';
|
|
2
|
+
import { i as index } from './vendor-entry.225630f2.js';
|
|
3
3
|
import 'url';
|
|
4
|
-
import './chunk-utils-global.
|
|
4
|
+
import './chunk-utils-global.550519fc.js';
|
|
5
5
|
import 'tty';
|
|
6
6
|
import 'local-pkg';
|
|
7
7
|
import 'path';
|
|
8
8
|
import 'fs';
|
|
9
|
-
import './chunk-runtime-chain.
|
|
9
|
+
import './chunk-runtime-chain.46442ffe.js';
|
|
10
10
|
import 'chai';
|
|
11
11
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
12
|
-
import './chunk-runtime-rpc.
|
|
13
|
-
import './chunk-utils-
|
|
12
|
+
import './chunk-runtime-rpc.50765c8b.js';
|
|
13
|
+
import './chunk-utils-source-map.19e9554e.js';
|
|
14
14
|
import './chunk-integrations-spy.bee66426.js';
|
|
15
15
|
import 'tinyspy';
|
|
16
16
|
import 'util';
|
|
17
|
-
import './chunk-defaults.
|
|
17
|
+
import './chunk-defaults.e5ec89dd.js';
|
|
18
18
|
import 'module';
|
|
19
19
|
|
|
20
20
|
function registerApiGlobally() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import chai$1, { expect as expect$1, AssertionError, util } from 'chai';
|
|
2
2
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
|
|
3
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
4
|
-
import { i as isObject, j as join, d as dirname, g as getCallLastIndex, s as slash, a as getWorkerState, b as getNames, c as assertTypes, p as picocolors, n as noop, t as toArray, r as resetModules } from './chunk-utils-global.
|
|
3
|
+
import { r as rpc } from './chunk-runtime-rpc.50765c8b.js';
|
|
4
|
+
import { i as isObject, j as join, d as dirname, g as getCallLastIndex, s as slash, a as getWorkerState, b as getNames, c as assertTypes, p as picocolors, e as safeSetTimeout, f as safeClearTimeout, n as noop, t as toArray, r as resetModules } from './chunk-utils-global.550519fc.js';
|
|
5
5
|
import fs, { promises } from 'fs';
|
|
6
|
-
import { p as plugins_1, f as format_1, g as getOriginalPos, a as posToNumber, n as numberToPos, l as lineSplitRE, b as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils
|
|
6
|
+
import { p as plugins_1, f as format_1, g as getOriginalPos, a as posToNumber, n as numberToPos, l as lineSplitRE, b as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils } from './chunk-utils-source-map.19e9554e.js';
|
|
7
7
|
import { i as isMockFunction, s as spyOn, f as fn, a as spies } from './chunk-integrations-spy.bee66426.js';
|
|
8
8
|
import require$$0, { format } from 'util';
|
|
9
9
|
|
|
@@ -329,7 +329,7 @@ const hasPropertyInObject = (object, key) => {
|
|
|
329
329
|
return false;
|
|
330
330
|
return Object.prototype.hasOwnProperty.call(object, key) || hasPropertyInObject(Object.getPrototypeOf(object), key);
|
|
331
331
|
};
|
|
332
|
-
const isObjectWithKeys = (a) => isObject(a) && !(a instanceof Error) && !(a
|
|
332
|
+
const isObjectWithKeys = (a) => isObject(a) && !(a instanceof Error) && !Array.isArray(a) && !(a instanceof Date);
|
|
333
333
|
const subsetEquality = (object, subset) => {
|
|
334
334
|
const subsetEqualityWithContext = (seenReferences = /* @__PURE__ */ new WeakMap()) => (object2, subset2) => {
|
|
335
335
|
if (!isObjectWithKeys(subset2))
|
|
@@ -621,14 +621,14 @@ function prepareSnapString(snap, source, index) {
|
|
|
621
621
|
const line = source.split(lineSplitRE)[lineIndex - 1];
|
|
622
622
|
const indent = line.match(/^\s*/)[0] || "";
|
|
623
623
|
const indentNext = indent.includes(" ") ? `${indent} ` : `${indent} `;
|
|
624
|
-
const lines = snap.trim().replace(/\\/g, "\\\\").
|
|
624
|
+
const lines = snap.trim().replace(/\\/g, "\\\\").split(/\n/g);
|
|
625
625
|
const isOneline = lines.length <= 1;
|
|
626
626
|
const quote = isOneline ? "'" : "`";
|
|
627
627
|
if (isOneline)
|
|
628
628
|
return `'${lines.join("\n").replace(/'/g, "\\'")}'`;
|
|
629
629
|
else
|
|
630
630
|
return `${quote}
|
|
631
|
-
${lines.map((i) => i ? indentNext + i : "").join("\n").replace(/`/g, "\\`")}
|
|
631
|
+
${lines.map((i) => i ? indentNext + i : "").join("\n").replace(/`/g, "\\`").replace(/\${/g, "\\${")}
|
|
632
632
|
${indent}${quote}`;
|
|
633
633
|
}
|
|
634
634
|
const startRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*[\w_$]*(['"`\)])/m;
|
|
@@ -1223,7 +1223,7 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
1223
1223
|
} else if (received === -Infinity && expected === -Infinity) {
|
|
1224
1224
|
pass = true;
|
|
1225
1225
|
} else {
|
|
1226
|
-
expectedDiff =
|
|
1226
|
+
expectedDiff = 10 ** -precision / 2;
|
|
1227
1227
|
receivedDiff = Math.abs(expected - received);
|
|
1228
1228
|
pass = receivedDiff < expectedDiff;
|
|
1229
1229
|
}
|
|
@@ -1717,7 +1717,8 @@ const getMatcherState = (assertion) => {
|
|
|
1717
1717
|
utils: jestUtils,
|
|
1718
1718
|
promise,
|
|
1719
1719
|
equals,
|
|
1720
|
-
suppressedErrors: []
|
|
1720
|
+
suppressedErrors: [],
|
|
1721
|
+
snapshotState: getSnapshotClient().snapshotState
|
|
1721
1722
|
});
|
|
1722
1723
|
return {
|
|
1723
1724
|
state: matcherState,
|
|
@@ -1838,8 +1839,8 @@ function withTimeout(fn, timeout = getDefaultTestTimeout(), isHook = false) {
|
|
|
1838
1839
|
return (...args) => {
|
|
1839
1840
|
return Promise.race([fn(...args), new Promise((resolve, reject) => {
|
|
1840
1841
|
var _a;
|
|
1841
|
-
const timer =
|
|
1842
|
-
|
|
1842
|
+
const timer = safeSetTimeout(() => {
|
|
1843
|
+
safeClearTimeout(timer);
|
|
1843
1844
|
reject(new Error(makeTimeoutMsg(isHook, timeout)));
|
|
1844
1845
|
}, timeout);
|
|
1845
1846
|
(_a = timer.unref) == null ? void 0 : _a.call(timer);
|
|
@@ -4850,6 +4851,16 @@ class VitestUtils {
|
|
|
4850
4851
|
resetModules();
|
|
4851
4852
|
return this;
|
|
4852
4853
|
}
|
|
4854
|
+
async dynamicImportSettled() {
|
|
4855
|
+
const state = getWorkerState();
|
|
4856
|
+
const promises = [];
|
|
4857
|
+
for (const mod of state.moduleCache.values()) {
|
|
4858
|
+
if (mod.promise)
|
|
4859
|
+
promises.push(mod.promise);
|
|
4860
|
+
}
|
|
4861
|
+
await Promise.allSettled(promises);
|
|
4862
|
+
await new Promise((resolve) => safeSetTimeout(resolve, 1)).then(() => Promise.resolve());
|
|
4863
|
+
}
|
|
4853
4864
|
}
|
|
4854
4865
|
const vitest = new VitestUtils();
|
|
4855
4866
|
const vi = vitest;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as normalizeRequestId, i as isNodeBuiltin, t as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.
|
|
1
|
+
import { n as normalizeRequestId, i as isNodeBuiltin, t as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.52235551.js';
|
|
2
2
|
import { normalizePath } from 'vite';
|
|
3
|
-
import { a as getWorkerState,
|
|
3
|
+
import { a as getWorkerState, J as isWindows, K as mergeSlashes, d as dirname, l as resolve, k as basename, L as getType, M as getAllProperties, s as slash } from './chunk-utils-global.550519fc.js';
|
|
4
4
|
import { existsSync, readdirSync } from 'fs';
|
|
5
|
-
import { d as distDir } from './chunk-constants.
|
|
5
|
+
import { d as distDir } from './chunk-constants.b0ea3b74.js';
|
|
6
6
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { a as getWorkerState, w as withSafeTimers } from './chunk-utils-global.550519fc.js';
|
|
2
|
+
|
|
3
|
+
const rpc = () => {
|
|
4
|
+
const { rpc: rpc2 } = getWorkerState();
|
|
5
|
+
return new Proxy(rpc2, {
|
|
6
|
+
get(target, p, handler) {
|
|
7
|
+
const sendCall = Reflect.get(target, p, handler);
|
|
8
|
+
const safeSendCall = (...args) => withSafeTimers(() => sendCall(...args));
|
|
9
|
+
safeSendCall.asEvent = sendCall.asEvent;
|
|
10
|
+
return safeSendCall;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { rpc as r };
|
|
@@ -385,6 +385,32 @@ function getNames(task) {
|
|
|
385
385
|
return names;
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
+
const {
|
|
389
|
+
setTimeout: safeSetTimeout,
|
|
390
|
+
setInterval: safeSetInterval,
|
|
391
|
+
clearInterval: safeClearInterval,
|
|
392
|
+
clearTimeout: safeClearTimeout
|
|
393
|
+
} = globalThis;
|
|
394
|
+
function withSafeTimers(fn) {
|
|
395
|
+
const currentSetTimeout = globalThis.setTimeout;
|
|
396
|
+
const currentSetInterval = globalThis.setInterval;
|
|
397
|
+
const currentClearInterval = globalThis.clearInterval;
|
|
398
|
+
const currentClearTimeout = globalThis.clearTimeout;
|
|
399
|
+
try {
|
|
400
|
+
globalThis.setTimeout = safeSetTimeout;
|
|
401
|
+
globalThis.setInterval = safeSetInterval;
|
|
402
|
+
globalThis.clearInterval = safeClearInterval;
|
|
403
|
+
globalThis.clearTimeout = safeClearTimeout;
|
|
404
|
+
const result = fn();
|
|
405
|
+
return result;
|
|
406
|
+
} finally {
|
|
407
|
+
globalThis.setTimeout = currentSetTimeout;
|
|
408
|
+
globalThis.setInterval = currentSetInterval;
|
|
409
|
+
globalThis.clearInterval = currentClearInterval;
|
|
410
|
+
globalThis.clearTimeout = currentClearTimeout;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
388
414
|
const isNode = typeof process !== "undefined" && typeof process.platform !== "undefined";
|
|
389
415
|
const isWindows = isNode && process.platform === "win32";
|
|
390
416
|
function partitionSuiteChildren(suite) {
|
|
@@ -433,7 +459,7 @@ async function ensurePackageInstalled(dependency, promptInstall = !process.env.C
|
|
|
433
459
|
message: picocolors.exports.reset(`Do you want to install ${picocolors.exports.green(dependency)}?`)
|
|
434
460
|
});
|
|
435
461
|
if (install) {
|
|
436
|
-
await (await import('./chunk-install-pkg.
|
|
462
|
+
await (await import('./chunk-install-pkg.e11db438.js')).installPackage(dependency, { dev: true });
|
|
437
463
|
process.stderr.write(picocolors.exports.yellow(`
|
|
438
464
|
Package ${dependency} installed, re-run the command to start.
|
|
439
465
|
`));
|
|
@@ -477,4 +503,4 @@ class AggregateErrorPonyfill extends Error {
|
|
|
477
503
|
}
|
|
478
504
|
}
|
|
479
505
|
|
|
480
|
-
export { AggregateErrorPonyfill as A,
|
|
506
|
+
export { AggregateErrorPonyfill as A, safeSetInterval as B, safeClearInterval as C, normalize as D, deepMerge as E, toNamespacedPath as F, ensurePackageInstalled as G, stdout as H, extname as I, isWindows as J, mergeSlashes as K, getType as L, getAllProperties as M, clone as N, partitionSuiteChildren as O, hasTests as P, getWorkerState as a, getNames as b, assertTypes as c, dirname as d, safeSetTimeout as e, safeClearTimeout as f, getCallLastIndex as g, notNullish as h, isObject as i, join as j, basename as k, resolve as l, isAbsolute as m, noop as n, relative as o, picocolors as p, isNode as q, resetModules as r, slash as s, toArray as t, getTests as u, getFullName as v, withSafeTimers as w, hasFailed as x, hasFailedSnapshot as y, getSuites as z };
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { s as slash,
|
|
2
|
-
|
|
3
|
-
const setTimeout$1 = globalThis.setTimeout;
|
|
4
|
-
const setInterval = globalThis.setInterval;
|
|
5
|
-
const clearInterval = globalThis.clearInterval;
|
|
6
|
-
const clearTimeout = globalThis.clearTimeout;
|
|
1
|
+
import { s as slash, h as notNullish, p as picocolors } from './chunk-utils-global.550519fc.js';
|
|
7
2
|
|
|
8
3
|
var build = {};
|
|
9
4
|
|
|
@@ -5765,6 +5760,11 @@ Diff.prototype = {
|
|
|
5765
5760
|
oldLen = oldString.length;
|
|
5766
5761
|
var editLength = 1;
|
|
5767
5762
|
var maxEditLength = newLen + oldLen;
|
|
5763
|
+
|
|
5764
|
+
if (options.maxEditLength) {
|
|
5765
|
+
maxEditLength = Math.min(maxEditLength, options.maxEditLength);
|
|
5766
|
+
}
|
|
5767
|
+
|
|
5768
5768
|
var bestPath = [{
|
|
5769
5769
|
newPos: -1,
|
|
5770
5770
|
components: []
|
|
@@ -5829,15 +5829,13 @@ Diff.prototype = {
|
|
|
5829
5829
|
editLength++;
|
|
5830
5830
|
} // Performs the length of edit iteration. Is a bit fugly as this has to support the
|
|
5831
5831
|
// sync and async mode which is never fun. Loops over execEditLength until a value
|
|
5832
|
-
// is produced.
|
|
5832
|
+
// is produced, or until the edit length exceeds options.maxEditLength (if given),
|
|
5833
|
+
// in which case it will return undefined.
|
|
5833
5834
|
|
|
5834
5835
|
|
|
5835
5836
|
if (callback) {
|
|
5836
5837
|
(function exec() {
|
|
5837
5838
|
setTimeout(function () {
|
|
5838
|
-
// This should not happen, but we want to be safe.
|
|
5839
|
-
|
|
5840
|
-
/* istanbul ignore next */
|
|
5841
5839
|
if (editLength > maxEditLength) {
|
|
5842
5840
|
return callback();
|
|
5843
5841
|
}
|
|
@@ -6236,6 +6234,11 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
|
|
|
6236
6234
|
}
|
|
6237
6235
|
|
|
6238
6236
|
var diff = diffLines(oldStr, newStr, options);
|
|
6237
|
+
|
|
6238
|
+
if (!diff) {
|
|
6239
|
+
return;
|
|
6240
|
+
}
|
|
6241
|
+
|
|
6239
6242
|
diff.push({
|
|
6240
6243
|
value: '',
|
|
6241
6244
|
lines: []
|
|
@@ -7425,4 +7428,4 @@ var matcherUtils = /*#__PURE__*/Object.freeze({
|
|
|
7425
7428
|
diff: diff
|
|
7426
7429
|
});
|
|
7427
7430
|
|
|
7428
|
-
export { posToNumber as a, parseStacktrace as b,
|
|
7431
|
+
export { posToNumber as a, parseStacktrace as b, stripAnsi as c, stringWidth as d, ansiStyles as e, format_1 as f, getOriginalPos as g, sliceAnsi as h, cliTruncate as i, interpretSourcePos as j, lineSplitRE as l, matcherUtils as m, numberToPos as n, plugins_1 as p, stringify as s, unifiedDiff as u };
|