vitest 0.9.4 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +7 -0
- package/dist/{chunk-api-setup.49283db8.js → chunk-api-setup.b55307fb.js} +41 -18
- package/dist/{chunk-constants.c8f1d38c.js → chunk-constants.90075174.js} +1 -1
- package/dist/{chunk-defaults.43e746f3.js → chunk-defaults.fd5b939d.js} +1 -1
- package/dist/{chunk-install-pkg.cbf3a38b.js → chunk-install-pkg.73b84ae1.js} +113 -115
- package/dist/chunk-integrations-globals.16d9702f.js +29 -0
- package/dist/chunk-integrations-spy.f036df6f.js +102 -0
- package/dist/{chunk-runtime-chain.701cffd8.js → chunk-runtime-chain.6292a3de.js} +941 -901
- package/dist/{chunk-runtime-mocker.e802beae.js → chunk-runtime-mocker.ca5ecf98.js} +5 -21
- package/dist/{chunk-runtime-rpc.c47f2233.js → chunk-runtime-rpc.8e14ae4f.js} +1 -1
- package/dist/{chunk-utils-global.a3293dce.js → chunk-utils-global.9b434e81.js} +42 -10
- package/dist/{chunk-utils-timers.b26e7c5c.js → chunk-utils-timers.c50fec92.js} +1406 -1057
- package/dist/{chunk-vite-node-externalize.1c19fc5e.js → chunk-vite-node-externalize.4255f25f.js} +661 -548
- package/dist/{chunk-vite-node-utils.b4debb0b.js → chunk-vite-node-utils.c160b239.js} +73 -71
- package/dist/cli.js +12 -12
- package/dist/entry.js +15 -919
- package/dist/index.d.ts +112 -31
- package/dist/index.js +8 -8
- package/dist/node.d.ts +40 -12
- package/dist/node.js +11 -11
- package/dist/spy.js +2 -102
- package/dist/vendor-_commonjsHelpers.addc3445.js +3 -0
- package/dist/vendor-entry.17835032.js +991 -0
- package/dist/vendor-index.405e58ef.js +6291 -0
- package/dist/{vendor-index.bd255bc8.js → vendor-index.40be925a.js} +173 -158
- package/dist/worker.js +9 -6
- package/package.json +9 -10
- package/vitest.mjs +1 -1
- package/dist/chunk-integrations-globals.b4a20711.js +0 -23
- package/dist/vendor-_commonjsHelpers.34b404ce.js +0 -7
- package/dist/vendor-index.13468339.js +0 -5707
package/LICENSE.md
CHANGED
|
@@ -465,6 +465,13 @@ Repository: git://github.com/kpdecker/jsdiff.git
|
|
|
465
465
|
|
|
466
466
|
---------------------------------------
|
|
467
467
|
|
|
468
|
+
## eastasianwidth
|
|
469
|
+
License: MIT
|
|
470
|
+
By: Masaki Komagata
|
|
471
|
+
Repository: git://github.com/komagata/eastasianwidth.git
|
|
472
|
+
|
|
473
|
+
---------------------------------------
|
|
474
|
+
|
|
468
475
|
## emoji-regex
|
|
469
476
|
License: MIT
|
|
470
477
|
By: Mathias Bynens
|
|
@@ -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.c160b239.js';
|
|
3
3
|
import require$$0$1 from 'stream';
|
|
4
4
|
import require$$0 from 'zlib';
|
|
5
5
|
import require$$3 from 'net';
|
|
@@ -9,14 +9,14 @@ 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 { r as interpretSourcePos, b as parseStacktrace } from './chunk-utils-timers.
|
|
12
|
+
import { A as API_PATH } from './chunk-constants.90075174.js';
|
|
13
|
+
import { r as interpretSourcePos, b as parseStacktrace } from './chunk-utils-timers.c50fec92.js';
|
|
14
14
|
import 'module';
|
|
15
15
|
import 'vm';
|
|
16
|
-
import './chunk-utils-global.
|
|
17
|
-
import 'path';
|
|
16
|
+
import './chunk-utils-global.9b434e81.js';
|
|
18
17
|
import 'tty';
|
|
19
18
|
import 'local-pkg';
|
|
19
|
+
import 'path';
|
|
20
20
|
import 'assert';
|
|
21
21
|
import 'util';
|
|
22
22
|
|
|
@@ -2526,10 +2526,11 @@ const {
|
|
|
2526
2526
|
const { format, parse: parse$1 } = extension$1;
|
|
2527
2527
|
const { toBuffer } = bufferUtil$1.exports;
|
|
2528
2528
|
|
|
2529
|
+
const closeTimeout = 30 * 1000;
|
|
2530
|
+
const kAborted = Symbol('kAborted');
|
|
2531
|
+
const protocolVersions = [8, 13];
|
|
2529
2532
|
const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
|
|
2530
2533
|
const subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
|
|
2531
|
-
const protocolVersions = [8, 13];
|
|
2532
|
-
const closeTimeout = 30 * 1000;
|
|
2533
2534
|
|
|
2534
2535
|
/**
|
|
2535
2536
|
* Class representing a WebSocket.
|
|
@@ -3143,7 +3144,7 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3143
3144
|
hostname: undefined,
|
|
3144
3145
|
protocol: undefined,
|
|
3145
3146
|
timeout: undefined,
|
|
3146
|
-
method:
|
|
3147
|
+
method: 'GET',
|
|
3147
3148
|
host: undefined,
|
|
3148
3149
|
path: undefined,
|
|
3149
3150
|
port: undefined
|
|
@@ -3197,7 +3198,7 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3197
3198
|
|
|
3198
3199
|
const defaultPort = isSecure ? 443 : 80;
|
|
3199
3200
|
const key = randomBytes(16).toString('base64');
|
|
3200
|
-
const
|
|
3201
|
+
const request = isSecure ? https.request : http$1.request;
|
|
3201
3202
|
const protocolSet = new Set();
|
|
3202
3203
|
let perMessageDeflate;
|
|
3203
3204
|
|
|
@@ -3262,6 +3263,8 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3262
3263
|
opts.path = parts[1];
|
|
3263
3264
|
}
|
|
3264
3265
|
|
|
3266
|
+
let req;
|
|
3267
|
+
|
|
3265
3268
|
if (opts.followRedirects) {
|
|
3266
3269
|
if (websocket._redirects === 0) {
|
|
3267
3270
|
websocket._originalHost = parsedUrl.host;
|
|
@@ -3279,7 +3282,10 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3279
3282
|
options.headers[key.toLowerCase()] = value;
|
|
3280
3283
|
}
|
|
3281
3284
|
}
|
|
3282
|
-
} else if (
|
|
3285
|
+
} else if (
|
|
3286
|
+
websocket.listenerCount('redirect') === 0 &&
|
|
3287
|
+
parsedUrl.host !== websocket._originalHost
|
|
3288
|
+
) {
|
|
3283
3289
|
//
|
|
3284
3290
|
// Match curl 7.77.0 behavior and drop the following headers. These
|
|
3285
3291
|
// headers are also dropped when following a redirect to a subdomain.
|
|
@@ -3299,9 +3305,24 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3299
3305
|
options.headers.authorization =
|
|
3300
3306
|
'Basic ' + Buffer.from(opts.auth).toString('base64');
|
|
3301
3307
|
}
|
|
3302
|
-
}
|
|
3303
3308
|
|
|
3304
|
-
|
|
3309
|
+
req = websocket._req = request(opts);
|
|
3310
|
+
|
|
3311
|
+
if (websocket._redirects) {
|
|
3312
|
+
//
|
|
3313
|
+
// Unlike what is done for the `'upgrade'` event, no early exit is
|
|
3314
|
+
// triggered here if the user calls `websocket.close()` or
|
|
3315
|
+
// `websocket.terminate()` from a listener of the `'redirect'` event. This
|
|
3316
|
+
// is because the user can also call `request.destroy()` with an error
|
|
3317
|
+
// before calling `websocket.close()` or `websocket.terminate()` and this
|
|
3318
|
+
// would result in an error being emitted on the `request` object with no
|
|
3319
|
+
// `'error'` event listeners attached.
|
|
3320
|
+
//
|
|
3321
|
+
websocket.emit('redirect', websocket.url, req);
|
|
3322
|
+
}
|
|
3323
|
+
} else {
|
|
3324
|
+
req = websocket._req = request(opts);
|
|
3325
|
+
}
|
|
3305
3326
|
|
|
3306
3327
|
if (opts.timeout) {
|
|
3307
3328
|
req.on('timeout', () => {
|
|
@@ -3310,7 +3331,7 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3310
3331
|
}
|
|
3311
3332
|
|
|
3312
3333
|
req.on('error', (err) => {
|
|
3313
|
-
if (req === null || req
|
|
3334
|
+
if (req === null || req[kAborted]) return;
|
|
3314
3335
|
|
|
3315
3336
|
req = websocket._req = null;
|
|
3316
3337
|
emitErrorAndClose(websocket, err);
|
|
@@ -3357,8 +3378,8 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3357
3378
|
websocket.emit('upgrade', res);
|
|
3358
3379
|
|
|
3359
3380
|
//
|
|
3360
|
-
// The user may have closed the connection from a listener of the
|
|
3361
|
-
// event.
|
|
3381
|
+
// The user may have closed the connection from a listener of the
|
|
3382
|
+
// `'upgrade'` event.
|
|
3362
3383
|
//
|
|
3363
3384
|
if (websocket.readyState !== WebSocket$1.CONNECTING) return;
|
|
3364
3385
|
|
|
@@ -3443,10 +3464,12 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3443
3464
|
skipUTF8Validation: opts.skipUTF8Validation
|
|
3444
3465
|
});
|
|
3445
3466
|
});
|
|
3467
|
+
|
|
3468
|
+
req.end();
|
|
3446
3469
|
}
|
|
3447
3470
|
|
|
3448
3471
|
/**
|
|
3449
|
-
* Emit the `'error'` and `'close'`
|
|
3472
|
+
* Emit the `'error'` and `'close'` events.
|
|
3450
3473
|
*
|
|
3451
3474
|
* @param {WebSocket} websocket The WebSocket instance
|
|
3452
3475
|
* @param {Error} The error to emit
|
|
@@ -3503,6 +3526,7 @@ function abortHandshake$1(websocket, stream, message) {
|
|
|
3503
3526
|
Error.captureStackTrace(err, abortHandshake$1);
|
|
3504
3527
|
|
|
3505
3528
|
if (stream.setHeader) {
|
|
3529
|
+
stream[kAborted] = true;
|
|
3506
3530
|
stream.abort();
|
|
3507
3531
|
|
|
3508
3532
|
if (stream.socket && !stream.socket.destroyed) {
|
|
@@ -3514,8 +3538,7 @@ function abortHandshake$1(websocket, stream, message) {
|
|
|
3514
3538
|
stream.socket.destroy();
|
|
3515
3539
|
}
|
|
3516
3540
|
|
|
3517
|
-
|
|
3518
|
-
websocket.emit('error', err);
|
|
3541
|
+
process.nextTick(emitErrorAndClose, websocket, err);
|
|
3519
3542
|
} else {
|
|
3520
3543
|
stream.destroy(err);
|
|
3521
3544
|
stream.once('error', websocket.emit.bind(websocket, 'error'));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from 'url';
|
|
2
|
-
import {
|
|
2
|
+
import { k as resolve } from './chunk-utils-global.9b434e81.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, k as resolve } from './chunk-utils-global.9b434e81.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,9 +2,9 @@ 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,
|
|
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.40be925a.js';
|
|
6
6
|
import require$$0$1 from 'os';
|
|
7
|
-
import './vendor-_commonjsHelpers.
|
|
7
|
+
import './vendor-_commonjsHelpers.addc3445.js';
|
|
8
8
|
import 'assert';
|
|
9
9
|
import 'events';
|
|
10
10
|
import 'buffer';
|
|
@@ -298,99 +298,99 @@ pathExists.exports.sync = path => {
|
|
|
298
298
|
};
|
|
299
299
|
|
|
300
300
|
(function (module) {
|
|
301
|
-
const path = path$2;
|
|
302
|
-
const locatePath$1 = locatePath.exports;
|
|
303
|
-
const pathExists$1 = pathExists.exports;
|
|
301
|
+
const path = path$2;
|
|
302
|
+
const locatePath$1 = locatePath.exports;
|
|
303
|
+
const pathExists$1 = pathExists.exports;
|
|
304
304
|
|
|
305
|
-
const stop = Symbol('findUp.stop');
|
|
305
|
+
const stop = Symbol('findUp.stop');
|
|
306
306
|
|
|
307
|
-
module.exports = async (name, options = {}) => {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
307
|
+
module.exports = async (name, options = {}) => {
|
|
308
|
+
let directory = path.resolve(options.cwd || '');
|
|
309
|
+
const {root} = path.parse(directory);
|
|
310
|
+
const paths = [].concat(name);
|
|
311
311
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
312
|
+
const runMatcher = async locateOptions => {
|
|
313
|
+
if (typeof name !== 'function') {
|
|
314
|
+
return locatePath$1(paths, locateOptions);
|
|
315
|
+
}
|
|
316
316
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
317
|
+
const foundPath = await name(locateOptions.cwd);
|
|
318
|
+
if (typeof foundPath === 'string') {
|
|
319
|
+
return locatePath$1([foundPath], locateOptions);
|
|
320
|
+
}
|
|
321
321
|
|
|
322
|
-
|
|
323
|
-
|
|
322
|
+
return foundPath;
|
|
323
|
+
};
|
|
324
324
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
// eslint-disable-next-line no-constant-condition
|
|
326
|
+
while (true) {
|
|
327
|
+
// eslint-disable-next-line no-await-in-loop
|
|
328
|
+
const foundPath = await runMatcher({...options, cwd: directory});
|
|
329
329
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
330
|
+
if (foundPath === stop) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
333
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
334
|
+
if (foundPath) {
|
|
335
|
+
return path.resolve(directory, foundPath);
|
|
336
|
+
}
|
|
337
337
|
|
|
338
|
-
|
|
339
|
-
|
|
338
|
+
if (directory === root) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
directory = path.dirname(directory);
|
|
340
343
|
}
|
|
344
|
+
};
|
|
341
345
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
};
|
|
346
|
+
module.exports.sync = (name, options = {}) => {
|
|
347
|
+
let directory = path.resolve(options.cwd || '');
|
|
348
|
+
const {root} = path.parse(directory);
|
|
349
|
+
const paths = [].concat(name);
|
|
345
350
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
351
|
+
const runMatcher = locateOptions => {
|
|
352
|
+
if (typeof name !== 'function') {
|
|
353
|
+
return locatePath$1.sync(paths, locateOptions);
|
|
354
|
+
}
|
|
350
355
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
356
|
+
const foundPath = name(locateOptions.cwd);
|
|
357
|
+
if (typeof foundPath === 'string') {
|
|
358
|
+
return locatePath$1.sync([foundPath], locateOptions);
|
|
359
|
+
}
|
|
355
360
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
return locatePath$1.sync([foundPath], locateOptions);
|
|
359
|
-
}
|
|
361
|
+
return foundPath;
|
|
362
|
+
};
|
|
360
363
|
|
|
361
|
-
|
|
362
|
-
|
|
364
|
+
// eslint-disable-next-line no-constant-condition
|
|
365
|
+
while (true) {
|
|
366
|
+
const foundPath = runMatcher({...options, cwd: directory});
|
|
363
367
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
368
|
+
if (foundPath === stop) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
367
371
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
372
|
+
if (foundPath) {
|
|
373
|
+
return path.resolve(directory, foundPath);
|
|
374
|
+
}
|
|
371
375
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
376
|
+
if (directory === root) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
375
379
|
|
|
376
|
-
|
|
377
|
-
return;
|
|
380
|
+
directory = path.dirname(directory);
|
|
378
381
|
}
|
|
382
|
+
};
|
|
379
383
|
|
|
380
|
-
|
|
381
|
-
}
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
module.exports.exists = pathExists$1;
|
|
384
|
+
module.exports.exists = pathExists$1;
|
|
385
385
|
|
|
386
|
-
module.exports.sync.exists = pathExists$1.sync;
|
|
386
|
+
module.exports.sync.exists = pathExists$1.sync;
|
|
387
387
|
|
|
388
|
-
module.exports.stop = stop;
|
|
389
|
-
}(findUp$1));
|
|
388
|
+
module.exports.stop = stop;
|
|
389
|
+
} (findUp$1));
|
|
390
390
|
|
|
391
391
|
var findUp = findUp$1.exports;
|
|
392
392
|
|
|
393
|
-
var execa$
|
|
393
|
+
var execa$1 = {exports: {}};
|
|
394
394
|
|
|
395
395
|
var stripFinalNewline$1 = input => {
|
|
396
396
|
const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
|
|
@@ -410,53 +410,53 @@ var stripFinalNewline$1 = input => {
|
|
|
410
410
|
var npmRunPath$1 = {exports: {}};
|
|
411
411
|
|
|
412
412
|
(function (module) {
|
|
413
|
-
const path = path$2;
|
|
414
|
-
const pathKey$1 = pathKey.exports;
|
|
415
|
-
|
|
416
|
-
const npmRunPath = options => {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
413
|
+
const path = path$2;
|
|
414
|
+
const pathKey$1 = pathKey.exports;
|
|
415
|
+
|
|
416
|
+
const npmRunPath = options => {
|
|
417
|
+
options = {
|
|
418
|
+
cwd: process.cwd(),
|
|
419
|
+
path: process.env[pathKey$1()],
|
|
420
|
+
execPath: process.execPath,
|
|
421
|
+
...options
|
|
422
|
+
};
|
|
423
423
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
let previous;
|
|
425
|
+
let cwdPath = path.resolve(options.cwd);
|
|
426
|
+
const result = [];
|
|
427
427
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
428
|
+
while (previous !== cwdPath) {
|
|
429
|
+
result.push(path.join(cwdPath, 'node_modules/.bin'));
|
|
430
|
+
previous = cwdPath;
|
|
431
|
+
cwdPath = path.resolve(cwdPath, '..');
|
|
432
|
+
}
|
|
433
433
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
434
|
+
// Ensure the running `node` binary is used
|
|
435
|
+
const execPathDir = path.resolve(options.cwd, options.execPath, '..');
|
|
436
|
+
result.push(execPathDir);
|
|
437
437
|
|
|
438
|
-
|
|
439
|
-
};
|
|
438
|
+
return result.concat(options.path).join(path.delimiter);
|
|
439
|
+
};
|
|
440
440
|
|
|
441
|
-
module.exports = npmRunPath;
|
|
442
|
-
// TODO: Remove this for the next major release
|
|
443
|
-
module.exports.default = npmRunPath;
|
|
441
|
+
module.exports = npmRunPath;
|
|
442
|
+
// TODO: Remove this for the next major release
|
|
443
|
+
module.exports.default = npmRunPath;
|
|
444
444
|
|
|
445
|
-
module.exports.env = options => {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
445
|
+
module.exports.env = options => {
|
|
446
|
+
options = {
|
|
447
|
+
env: process.env,
|
|
448
|
+
...options
|
|
449
|
+
};
|
|
450
450
|
|
|
451
|
-
|
|
452
|
-
|
|
451
|
+
const env = {...options.env};
|
|
452
|
+
const path = pathKey$1({env});
|
|
453
453
|
|
|
454
|
-
|
|
455
|
-
|
|
454
|
+
options.path = env[path];
|
|
455
|
+
env[path] = module.exports(options);
|
|
456
456
|
|
|
457
|
-
|
|
458
|
-
};
|
|
459
|
-
}(npmRunPath$1));
|
|
457
|
+
return env;
|
|
458
|
+
};
|
|
459
|
+
} (npmRunPath$1));
|
|
460
460
|
|
|
461
461
|
var main = {};
|
|
462
462
|
|
|
@@ -1501,9 +1501,9 @@ const execa = (file, args, options) => {
|
|
|
1501
1501
|
return mergePromise(spawned, handlePromiseOnce);
|
|
1502
1502
|
};
|
|
1503
1503
|
|
|
1504
|
-
execa$
|
|
1504
|
+
execa$1.exports = execa;
|
|
1505
1505
|
|
|
1506
|
-
execa$
|
|
1506
|
+
execa$1.exports.sync = (file, args, options) => {
|
|
1507
1507
|
const parsed = handleArguments(file, args, options);
|
|
1508
1508
|
const command = joinCommand(file, args);
|
|
1509
1509
|
const escapedCommand = getEscapedCommand(file, args);
|
|
@@ -1566,17 +1566,17 @@ execa$2.exports.sync = (file, args, options) => {
|
|
|
1566
1566
|
};
|
|
1567
1567
|
};
|
|
1568
1568
|
|
|
1569
|
-
execa$
|
|
1569
|
+
execa$1.exports.command = (command, options) => {
|
|
1570
1570
|
const [file, ...args] = parseCommand(command);
|
|
1571
1571
|
return execa(file, args, options);
|
|
1572
1572
|
};
|
|
1573
1573
|
|
|
1574
|
-
execa$
|
|
1574
|
+
execa$1.exports.commandSync = (command, options) => {
|
|
1575
1575
|
const [file, ...args] = parseCommand(command);
|
|
1576
1576
|
return execa.sync(file, args, options);
|
|
1577
1577
|
};
|
|
1578
1578
|
|
|
1579
|
-
execa$
|
|
1579
|
+
execa$1.exports.node = (scriptPath, args, options = {}) => {
|
|
1580
1580
|
if (args && !Array.isArray(args) && typeof args === 'object') {
|
|
1581
1581
|
options = args;
|
|
1582
1582
|
args = [];
|
|
@@ -1608,8 +1608,6 @@ execa$2.exports.node = (scriptPath, args, options = {}) => {
|
|
|
1608
1608
|
);
|
|
1609
1609
|
};
|
|
1610
1610
|
|
|
1611
|
-
var execa$1 = execa$2.exports;
|
|
1612
|
-
|
|
1613
1611
|
// src/detect.ts
|
|
1614
1612
|
var LOCKS = {
|
|
1615
1613
|
"pnpm-lock.yaml": "pnpm",
|
|
@@ -1628,7 +1626,7 @@ async function installPackage(names, options = {}) {
|
|
|
1628
1626
|
const args = options.additionalArgs || [];
|
|
1629
1627
|
if (options.preferOffline)
|
|
1630
1628
|
args.unshift("--prefer-offline");
|
|
1631
|
-
return execa$1(agent, [
|
|
1629
|
+
return execa$1.exports(agent, [
|
|
1632
1630
|
agent === "yarn" ? "add" : "install",
|
|
1633
1631
|
options.dev ? "-D" : "",
|
|
1634
1632
|
...args,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { g as globalApis } from './chunk-constants.90075174.js';
|
|
2
|
+
import { i as index } from './vendor-entry.17835032.js';
|
|
3
|
+
import 'url';
|
|
4
|
+
import './chunk-utils-global.9b434e81.js';
|
|
5
|
+
import 'tty';
|
|
6
|
+
import 'local-pkg';
|
|
7
|
+
import 'path';
|
|
8
|
+
import 'fs';
|
|
9
|
+
import 'console';
|
|
10
|
+
import 'stream';
|
|
11
|
+
import './chunk-runtime-chain.6292a3de.js';
|
|
12
|
+
import 'chai';
|
|
13
|
+
import './vendor-_commonjsHelpers.addc3445.js';
|
|
14
|
+
import './chunk-runtime-rpc.8e14ae4f.js';
|
|
15
|
+
import './chunk-utils-timers.c50fec92.js';
|
|
16
|
+
import './chunk-integrations-spy.f036df6f.js';
|
|
17
|
+
import 'tinyspy';
|
|
18
|
+
import 'util';
|
|
19
|
+
import './chunk-defaults.fd5b939d.js';
|
|
20
|
+
import 'module';
|
|
21
|
+
import 'crypto';
|
|
22
|
+
|
|
23
|
+
function registerApiGlobally() {
|
|
24
|
+
globalApis.forEach((api) => {
|
|
25
|
+
globalThis[api] = index[api];
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { registerApiGlobally };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as tinyspy from 'tinyspy';
|
|
2
|
+
|
|
3
|
+
const spies = /* @__PURE__ */ new Set();
|
|
4
|
+
function isMockFunction(fn2) {
|
|
5
|
+
return typeof fn2 === "function" && "_isMockFunction" in fn2 && fn2._isMockFunction;
|
|
6
|
+
}
|
|
7
|
+
function spyOn(obj, method, accessType) {
|
|
8
|
+
const dictionary = {
|
|
9
|
+
get: "getter",
|
|
10
|
+
set: "setter"
|
|
11
|
+
};
|
|
12
|
+
const objMethod = accessType ? { [dictionary[accessType]]: method } : method;
|
|
13
|
+
const stub = tinyspy.spyOn(obj, objMethod);
|
|
14
|
+
return enhanceSpy(stub);
|
|
15
|
+
}
|
|
16
|
+
let callOrder = 0;
|
|
17
|
+
function enhanceSpy(spy) {
|
|
18
|
+
const stub = spy;
|
|
19
|
+
let implementation;
|
|
20
|
+
let instances = [];
|
|
21
|
+
let invocations = [];
|
|
22
|
+
const mockContext = {
|
|
23
|
+
get calls() {
|
|
24
|
+
return stub.calls;
|
|
25
|
+
},
|
|
26
|
+
get instances() {
|
|
27
|
+
return instances;
|
|
28
|
+
},
|
|
29
|
+
get invocationCallOrder() {
|
|
30
|
+
return invocations;
|
|
31
|
+
},
|
|
32
|
+
get results() {
|
|
33
|
+
return stub.results.map(([callType, value]) => {
|
|
34
|
+
const type = callType === "error" ? "throw" : "return";
|
|
35
|
+
return { type, value };
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
get lastCall() {
|
|
39
|
+
return stub.calls.at(-1);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
let onceImplementations = [];
|
|
43
|
+
let name = stub.name;
|
|
44
|
+
stub.getMockName = () => name || "vi.fn()";
|
|
45
|
+
stub.mockName = (n) => {
|
|
46
|
+
name = n;
|
|
47
|
+
return stub;
|
|
48
|
+
};
|
|
49
|
+
stub.mockClear = () => {
|
|
50
|
+
stub.reset();
|
|
51
|
+
instances = [];
|
|
52
|
+
invocations = [];
|
|
53
|
+
return stub;
|
|
54
|
+
};
|
|
55
|
+
stub.mockReset = () => {
|
|
56
|
+
stub.mockClear();
|
|
57
|
+
implementation = () => void 0;
|
|
58
|
+
onceImplementations = [];
|
|
59
|
+
return stub;
|
|
60
|
+
};
|
|
61
|
+
stub.mockRestore = () => {
|
|
62
|
+
stub.mockReset();
|
|
63
|
+
implementation = void 0;
|
|
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.mockImplementationOnce(() => Promise.reject(val));
|
|
84
|
+
Object.defineProperty(stub, "mock", {
|
|
85
|
+
get: () => mockContext
|
|
86
|
+
});
|
|
87
|
+
stub.willCall(function(...args) {
|
|
88
|
+
instances.push(this);
|
|
89
|
+
invocations.push(++callOrder);
|
|
90
|
+
const impl = onceImplementations.shift() || implementation || stub.getOriginal() || (() => {
|
|
91
|
+
});
|
|
92
|
+
return impl.apply(this, args);
|
|
93
|
+
});
|
|
94
|
+
spies.add(stub);
|
|
95
|
+
return stub;
|
|
96
|
+
}
|
|
97
|
+
function fn(implementation) {
|
|
98
|
+
return enhanceSpy(tinyspy.spyOn({ fn: implementation || (() => {
|
|
99
|
+
}) }, "fn"));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { spies as a, fn as f, isMockFunction as i, spyOn as s };
|