vitest 0.29.7 → 0.30.0
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 +3 -266
- package/dist/browser.d.ts +16 -4
- package/dist/browser.js +5 -4
- package/dist/child.js +12 -17
- package/dist/{chunk-api-setup.ac7748ac.js → chunk-api-setup.6662587e.js} +65 -51
- package/dist/{chunk-install-pkg.863031f2.js → chunk-install-pkg.6450b372.js} +33 -32
- package/dist/chunk-integrations-globals.d419838f.js +26 -0
- package/dist/{chunk-node-git.ed5bded8.js → chunk-node-git.4c43bd73.js} +4 -2
- package/dist/cli-wrapper.js +6 -5
- package/dist/cli.js +27 -26
- package/dist/config.cjs +15 -7
- package/dist/config.d.ts +15 -8
- package/dist/config.js +10 -6
- package/dist/coverage.d.ts +5 -2
- package/dist/coverage.js +6 -0
- package/dist/entry.js +35 -34
- package/dist/environments.d.ts +5 -2
- package/dist/environments.js +1 -1
- package/dist/index.d.ts +17 -21
- package/dist/index.js +9 -10
- package/dist/loader.js +396 -12
- package/dist/node.d.ts +9 -7
- package/dist/node.js +28 -30
- package/dist/runners.d.ts +5 -2
- package/dist/runners.js +34 -30
- package/dist/{types-fafda418.d.ts → types-f03c83c4.d.ts} +243 -317
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -0
- package/dist/{chunk-node-pkg.f9696901.js → vendor-cli-api.c04eaa34.js} +3858 -5514
- package/dist/vendor-constants.538d9b49.js +54 -0
- package/dist/{chunk-integrations-coverage.e0a6acd2.js → vendor-coverage.a585b712.js} +5 -5
- package/dist/{chunk-runtime-mocker.344fec90.js → vendor-execute.8eaab47b.js} +9 -12
- package/dist/vendor-global.6795f91f.js +8 -0
- package/dist/vendor-index.4f82d248.js +161 -0
- package/dist/{chunk-env-node.affdd278.js → vendor-index.75f2b63d.js} +9 -2
- package/dist/{chunk-integrations-utils.d7c85bd9.js → vendor-index.81b9e499.js} +22 -21
- package/dist/{vendor-index.2cbcdd1e.js → vendor-index.c1e09929.js} +458 -373
- package/dist/vendor-index.fad2598b.js +44 -0
- package/dist/{vendor-index.534e612c.js → vendor-index.fc98d30f.js} +2 -2
- package/dist/{chunk-runtime-inspector.b1427a10.js → vendor-inspector.47fc8cbb.js} +5 -2
- package/dist/{chunk-runtime-rpc.1b5714dc.js → vendor-rpc.4d3d7a54.js} +5 -5
- package/dist/{chunk-integrations-run-once.a2b4758b.js → vendor-run-once.69ce7172.js} +3 -2
- package/dist/{chunk-runtime-setup.a49dc2f9.js → vendor-setup.common.cef38f4e.js} +2 -2
- package/dist/vendor-tasks.042d6084.js +14 -0
- package/dist/{chunk-utils-import.39ffe9c5.js → vendor-vi.a3ff54b1.js} +262 -3147
- package/dist/worker.js +13 -19
- package/package.json +40 -34
- package/utils.d.ts +1 -0
- package/dist/chunk-constants.bc18a549.js +0 -36
- package/dist/chunk-integrations-globals.a473e88a.js +0 -27
- package/dist/chunk-snapshot-env.a347d647.js +0 -11
- package/dist/chunk-utils-base.81f83dbd.js +0 -88
- package/dist/chunk-utils-env.04ffbef7.js +0 -70
- package/dist/chunk-utils-tasks.b41c8284.js +0 -107
- package/dist/env-afee91f0.d.ts +0 -10
- package/dist/vendor-index.783e7f3e.js +0 -71
- package/dist/vendor-index.bdee400f.js +0 -396
- package/dist/vendor-magic-string.es.b3bc5745.js +0 -1591
- /package/dist/{vendor-_commonjsHelpers.addc3445.js → vendor-_commonjsHelpers.76cdd49e.js} +0 -0
- /package/dist/{chunk-paths.e36446b4.js → vendor-paths.84fc7a99.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises, existsSync } from 'node:fs';
|
|
2
|
-
import { c as createBirpc } from './vendor-index.
|
|
2
|
+
import { c as createBirpc, i as isPrimitive } from './vendor-index.4f82d248.js';
|
|
3
3
|
import require$$0$2 from 'stream';
|
|
4
4
|
import require$$0 from 'zlib';
|
|
5
5
|
import require$$0$1 from 'buffer';
|
|
@@ -10,17 +10,15 @@ import require$$2 from 'events';
|
|
|
10
10
|
import require$$1 from 'https';
|
|
11
11
|
import require$$2$1 from 'http';
|
|
12
12
|
import require$$7 from 'url';
|
|
13
|
-
import { A as API_PATH } from './
|
|
14
|
-
import './
|
|
15
|
-
import {
|
|
13
|
+
import { A as API_PATH } from './vendor-constants.538d9b49.js';
|
|
14
|
+
import './vendor-index.fad2598b.js';
|
|
15
|
+
import { parseErrorStacktrace } from '@vitest/utils';
|
|
16
16
|
import 'pathe';
|
|
17
17
|
import 'std-env';
|
|
18
18
|
import '@vitest/runner/utils';
|
|
19
|
-
import '
|
|
20
|
-
import './chunk-utils-base.81f83dbd.js';
|
|
19
|
+
import './vendor-global.6795f91f.js';
|
|
21
20
|
|
|
22
21
|
async function getModuleGraph(ctx, id) {
|
|
23
|
-
var _a;
|
|
24
22
|
const graph = {};
|
|
25
23
|
const externalized = /* @__PURE__ */ new Set();
|
|
26
24
|
const inlined = /* @__PURE__ */ new Set();
|
|
@@ -46,7 +44,7 @@ async function getModuleGraph(ctx, id) {
|
|
|
46
44
|
graph[id2] = (await Promise.all(mods.map((m) => get(m, seen)))).filter(Boolean);
|
|
47
45
|
return id2;
|
|
48
46
|
}
|
|
49
|
-
await get(ctx.server.moduleGraph.getModuleById(id)
|
|
47
|
+
await get(ctx.server.moduleGraph.getModuleById(id));
|
|
50
48
|
return {
|
|
51
49
|
graph,
|
|
52
50
|
externalized: Array.from(externalized),
|
|
@@ -299,7 +297,7 @@ const kRun = Symbol('kRun');
|
|
|
299
297
|
* A very simple job queue with adjustable concurrency. Adapted from
|
|
300
298
|
* https://github.com/STRML/async-limiter
|
|
301
299
|
*/
|
|
302
|
-
|
|
300
|
+
let Limiter$1 = class Limiter {
|
|
303
301
|
/**
|
|
304
302
|
* Creates a new `Limiter`.
|
|
305
303
|
*
|
|
@@ -342,7 +340,7 @@ class Limiter$1 {
|
|
|
342
340
|
job(this[kDone]);
|
|
343
341
|
}
|
|
344
342
|
}
|
|
345
|
-
}
|
|
343
|
+
};
|
|
346
344
|
|
|
347
345
|
var limiter = Limiter$1;
|
|
348
346
|
|
|
@@ -372,7 +370,7 @@ let zlibLimiter;
|
|
|
372
370
|
/**
|
|
373
371
|
* permessage-deflate implementation.
|
|
374
372
|
*/
|
|
375
|
-
|
|
373
|
+
let PerMessageDeflate$4 = class PerMessageDeflate {
|
|
376
374
|
/**
|
|
377
375
|
* Creates a PerMessageDeflate instance.
|
|
378
376
|
*
|
|
@@ -804,7 +802,7 @@ class PerMessageDeflate$4 {
|
|
|
804
802
|
callback(null, data);
|
|
805
803
|
});
|
|
806
804
|
}
|
|
807
|
-
}
|
|
805
|
+
};
|
|
808
806
|
|
|
809
807
|
var permessageDeflate = PerMessageDeflate$4;
|
|
810
808
|
|
|
@@ -1017,7 +1015,7 @@ const INFLATING = 5;
|
|
|
1017
1015
|
*
|
|
1018
1016
|
* @extends Writable
|
|
1019
1017
|
*/
|
|
1020
|
-
|
|
1018
|
+
let Receiver$1 = class Receiver extends Writable {
|
|
1021
1019
|
/**
|
|
1022
1020
|
* Creates a Receiver instance.
|
|
1023
1021
|
*
|
|
@@ -1591,7 +1589,7 @@ class Receiver$1 extends Writable {
|
|
|
1591
1589
|
|
|
1592
1590
|
this._state = GET_INFO;
|
|
1593
1591
|
}
|
|
1594
|
-
}
|
|
1592
|
+
};
|
|
1595
1593
|
|
|
1596
1594
|
var receiver = Receiver$1;
|
|
1597
1595
|
|
|
@@ -1632,7 +1630,7 @@ const maskBuffer = Buffer.alloc(4);
|
|
|
1632
1630
|
/**
|
|
1633
1631
|
* HyBi Sender implementation.
|
|
1634
1632
|
*/
|
|
1635
|
-
|
|
1633
|
+
let Sender$1 = class Sender {
|
|
1636
1634
|
/**
|
|
1637
1635
|
* Creates a Sender instance.
|
|
1638
1636
|
*
|
|
@@ -1809,7 +1807,7 @@ class Sender$1 {
|
|
|
1809
1807
|
if (this._deflating) {
|
|
1810
1808
|
this.enqueue([this.dispatch, buf, false, options, cb]);
|
|
1811
1809
|
} else {
|
|
1812
|
-
this.sendFrame(Sender
|
|
1810
|
+
this.sendFrame(Sender.frame(buf, options), cb);
|
|
1813
1811
|
}
|
|
1814
1812
|
}
|
|
1815
1813
|
|
|
@@ -1852,7 +1850,7 @@ class Sender$1 {
|
|
|
1852
1850
|
if (this._deflating) {
|
|
1853
1851
|
this.enqueue([this.dispatch, data, false, options, cb]);
|
|
1854
1852
|
} else {
|
|
1855
|
-
this.sendFrame(Sender
|
|
1853
|
+
this.sendFrame(Sender.frame(data, options), cb);
|
|
1856
1854
|
}
|
|
1857
1855
|
}
|
|
1858
1856
|
|
|
@@ -1895,7 +1893,7 @@ class Sender$1 {
|
|
|
1895
1893
|
if (this._deflating) {
|
|
1896
1894
|
this.enqueue([this.dispatch, data, false, options, cb]);
|
|
1897
1895
|
} else {
|
|
1898
|
-
this.sendFrame(Sender
|
|
1896
|
+
this.sendFrame(Sender.frame(data, options), cb);
|
|
1899
1897
|
}
|
|
1900
1898
|
}
|
|
1901
1899
|
|
|
@@ -1972,7 +1970,7 @@ class Sender$1 {
|
|
|
1972
1970
|
}
|
|
1973
1971
|
} else {
|
|
1974
1972
|
this.sendFrame(
|
|
1975
|
-
Sender
|
|
1973
|
+
Sender.frame(data, {
|
|
1976
1974
|
[kByteLength]: byteLength,
|
|
1977
1975
|
fin: options.fin,
|
|
1978
1976
|
generateMask: this._generateMask,
|
|
@@ -2012,7 +2010,7 @@ class Sender$1 {
|
|
|
2012
2010
|
*/
|
|
2013
2011
|
dispatch(data, compress, options, cb) {
|
|
2014
2012
|
if (!compress) {
|
|
2015
|
-
this.sendFrame(Sender
|
|
2013
|
+
this.sendFrame(Sender.frame(data, options), cb);
|
|
2016
2014
|
return;
|
|
2017
2015
|
}
|
|
2018
2016
|
|
|
@@ -2041,7 +2039,7 @@ class Sender$1 {
|
|
|
2041
2039
|
this._bufferedBytes -= options[kByteLength];
|
|
2042
2040
|
this._deflating = false;
|
|
2043
2041
|
options.readOnly = false;
|
|
2044
|
-
this.sendFrame(Sender
|
|
2042
|
+
this.sendFrame(Sender.frame(buf, options), cb);
|
|
2045
2043
|
this.dequeue();
|
|
2046
2044
|
});
|
|
2047
2045
|
}
|
|
@@ -2088,7 +2086,7 @@ class Sender$1 {
|
|
|
2088
2086
|
this._socket.write(list[0], cb);
|
|
2089
2087
|
}
|
|
2090
2088
|
}
|
|
2091
|
-
}
|
|
2089
|
+
};
|
|
2092
2090
|
|
|
2093
2091
|
var sender = Sender$1;
|
|
2094
2092
|
|
|
@@ -2625,7 +2623,7 @@ const subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
|
|
|
2625
2623
|
*
|
|
2626
2624
|
* @extends EventEmitter
|
|
2627
2625
|
*/
|
|
2628
|
-
|
|
2626
|
+
let WebSocket$1 = class WebSocket extends EventEmitter$1 {
|
|
2629
2627
|
/**
|
|
2630
2628
|
* Create a new `WebSocket`.
|
|
2631
2629
|
*
|
|
@@ -2645,7 +2643,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2645
2643
|
this._extensions = {};
|
|
2646
2644
|
this._paused = false;
|
|
2647
2645
|
this._protocol = '';
|
|
2648
|
-
this._readyState = WebSocket
|
|
2646
|
+
this._readyState = WebSocket.CONNECTING;
|
|
2649
2647
|
this._receiver = null;
|
|
2650
2648
|
this._sender = null;
|
|
2651
2649
|
this._socket = null;
|
|
@@ -2817,7 +2815,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2817
2815
|
socket.on('end', socketOnEnd);
|
|
2818
2816
|
socket.on('error', socketOnError$1);
|
|
2819
2817
|
|
|
2820
|
-
this._readyState = WebSocket
|
|
2818
|
+
this._readyState = WebSocket.OPEN;
|
|
2821
2819
|
this.emit('open');
|
|
2822
2820
|
}
|
|
2823
2821
|
|
|
@@ -2828,7 +2826,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2828
2826
|
*/
|
|
2829
2827
|
emitClose() {
|
|
2830
2828
|
if (!this._socket) {
|
|
2831
|
-
this._readyState = WebSocket
|
|
2829
|
+
this._readyState = WebSocket.CLOSED;
|
|
2832
2830
|
this.emit('close', this._closeCode, this._closeMessage);
|
|
2833
2831
|
return;
|
|
2834
2832
|
}
|
|
@@ -2838,7 +2836,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2838
2836
|
}
|
|
2839
2837
|
|
|
2840
2838
|
this._receiver.removeAllListeners();
|
|
2841
|
-
this._readyState = WebSocket
|
|
2839
|
+
this._readyState = WebSocket.CLOSED;
|
|
2842
2840
|
this.emit('close', this._closeCode, this._closeMessage);
|
|
2843
2841
|
}
|
|
2844
2842
|
|
|
@@ -2863,14 +2861,14 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2863
2861
|
* @public
|
|
2864
2862
|
*/
|
|
2865
2863
|
close(code, data) {
|
|
2866
|
-
if (this.readyState === WebSocket
|
|
2867
|
-
if (this.readyState === WebSocket
|
|
2864
|
+
if (this.readyState === WebSocket.CLOSED) return;
|
|
2865
|
+
if (this.readyState === WebSocket.CONNECTING) {
|
|
2868
2866
|
const msg = 'WebSocket was closed before the connection was established';
|
|
2869
2867
|
abortHandshake$1(this, this._req, msg);
|
|
2870
2868
|
return;
|
|
2871
2869
|
}
|
|
2872
2870
|
|
|
2873
|
-
if (this.readyState === WebSocket
|
|
2871
|
+
if (this.readyState === WebSocket.CLOSING) {
|
|
2874
2872
|
if (
|
|
2875
2873
|
this._closeFrameSent &&
|
|
2876
2874
|
(this._closeFrameReceived || this._receiver._writableState.errorEmitted)
|
|
@@ -2881,7 +2879,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2881
2879
|
return;
|
|
2882
2880
|
}
|
|
2883
2881
|
|
|
2884
|
-
this._readyState = WebSocket
|
|
2882
|
+
this._readyState = WebSocket.CLOSING;
|
|
2885
2883
|
this._sender.close(code, data, !this._isServer, (err) => {
|
|
2886
2884
|
//
|
|
2887
2885
|
// This error is handled by the `'error'` listener on the socket. We only
|
|
@@ -2915,8 +2913,8 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2915
2913
|
*/
|
|
2916
2914
|
pause() {
|
|
2917
2915
|
if (
|
|
2918
|
-
this.readyState === WebSocket
|
|
2919
|
-
this.readyState === WebSocket
|
|
2916
|
+
this.readyState === WebSocket.CONNECTING ||
|
|
2917
|
+
this.readyState === WebSocket.CLOSED
|
|
2920
2918
|
) {
|
|
2921
2919
|
return;
|
|
2922
2920
|
}
|
|
@@ -2934,7 +2932,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2934
2932
|
* @public
|
|
2935
2933
|
*/
|
|
2936
2934
|
ping(data, mask, cb) {
|
|
2937
|
-
if (this.readyState === WebSocket
|
|
2935
|
+
if (this.readyState === WebSocket.CONNECTING) {
|
|
2938
2936
|
throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
|
|
2939
2937
|
}
|
|
2940
2938
|
|
|
@@ -2948,7 +2946,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2948
2946
|
|
|
2949
2947
|
if (typeof data === 'number') data = data.toString();
|
|
2950
2948
|
|
|
2951
|
-
if (this.readyState !== WebSocket
|
|
2949
|
+
if (this.readyState !== WebSocket.OPEN) {
|
|
2952
2950
|
sendAfterClose(this, data, cb);
|
|
2953
2951
|
return;
|
|
2954
2952
|
}
|
|
@@ -2966,7 +2964,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2966
2964
|
* @public
|
|
2967
2965
|
*/
|
|
2968
2966
|
pong(data, mask, cb) {
|
|
2969
|
-
if (this.readyState === WebSocket
|
|
2967
|
+
if (this.readyState === WebSocket.CONNECTING) {
|
|
2970
2968
|
throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
|
|
2971
2969
|
}
|
|
2972
2970
|
|
|
@@ -2980,7 +2978,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2980
2978
|
|
|
2981
2979
|
if (typeof data === 'number') data = data.toString();
|
|
2982
2980
|
|
|
2983
|
-
if (this.readyState !== WebSocket
|
|
2981
|
+
if (this.readyState !== WebSocket.OPEN) {
|
|
2984
2982
|
sendAfterClose(this, data, cb);
|
|
2985
2983
|
return;
|
|
2986
2984
|
}
|
|
@@ -2996,8 +2994,8 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
2996
2994
|
*/
|
|
2997
2995
|
resume() {
|
|
2998
2996
|
if (
|
|
2999
|
-
this.readyState === WebSocket
|
|
3000
|
-
this.readyState === WebSocket
|
|
2997
|
+
this.readyState === WebSocket.CONNECTING ||
|
|
2998
|
+
this.readyState === WebSocket.CLOSED
|
|
3001
2999
|
) {
|
|
3002
3000
|
return;
|
|
3003
3001
|
}
|
|
@@ -3022,7 +3020,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
3022
3020
|
* @public
|
|
3023
3021
|
*/
|
|
3024
3022
|
send(data, options, cb) {
|
|
3025
|
-
if (this.readyState === WebSocket
|
|
3023
|
+
if (this.readyState === WebSocket.CONNECTING) {
|
|
3026
3024
|
throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
|
|
3027
3025
|
}
|
|
3028
3026
|
|
|
@@ -3033,7 +3031,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
3033
3031
|
|
|
3034
3032
|
if (typeof data === 'number') data = data.toString();
|
|
3035
3033
|
|
|
3036
|
-
if (this.readyState !== WebSocket
|
|
3034
|
+
if (this.readyState !== WebSocket.OPEN) {
|
|
3037
3035
|
sendAfterClose(this, data, cb);
|
|
3038
3036
|
return;
|
|
3039
3037
|
}
|
|
@@ -3059,19 +3057,19 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
3059
3057
|
* @public
|
|
3060
3058
|
*/
|
|
3061
3059
|
terminate() {
|
|
3062
|
-
if (this.readyState === WebSocket
|
|
3063
|
-
if (this.readyState === WebSocket
|
|
3060
|
+
if (this.readyState === WebSocket.CLOSED) return;
|
|
3061
|
+
if (this.readyState === WebSocket.CONNECTING) {
|
|
3064
3062
|
const msg = 'WebSocket was closed before the connection was established';
|
|
3065
3063
|
abortHandshake$1(this, this._req, msg);
|
|
3066
3064
|
return;
|
|
3067
3065
|
}
|
|
3068
3066
|
|
|
3069
3067
|
if (this._socket) {
|
|
3070
|
-
this._readyState = WebSocket
|
|
3068
|
+
this._readyState = WebSocket.CLOSING;
|
|
3071
3069
|
this._socket.destroy();
|
|
3072
3070
|
}
|
|
3073
3071
|
}
|
|
3074
|
-
}
|
|
3072
|
+
};
|
|
3075
3073
|
|
|
3076
3074
|
/**
|
|
3077
3075
|
* @constant {Number} CONNECTING
|
|
@@ -3573,7 +3571,11 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
3573
3571
|
});
|
|
3574
3572
|
});
|
|
3575
3573
|
|
|
3576
|
-
|
|
3574
|
+
if (opts.finishRequest) {
|
|
3575
|
+
opts.finishRequest(req, websocket);
|
|
3576
|
+
} else {
|
|
3577
|
+
req.end();
|
|
3578
|
+
}
|
|
3577
3579
|
}
|
|
3578
3580
|
|
|
3579
3581
|
/**
|
|
@@ -4482,8 +4484,9 @@ function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
|
|
|
4482
4484
|
}
|
|
4483
4485
|
}
|
|
4484
4486
|
|
|
4485
|
-
function setup(
|
|
4487
|
+
function setup(vitestOrWorkspace, server) {
|
|
4486
4488
|
var _a;
|
|
4489
|
+
const ctx = "ctx" in vitestOrWorkspace ? vitestOrWorkspace.ctx : vitestOrWorkspace;
|
|
4487
4490
|
const wss = new websocketServer({ noServer: true });
|
|
4488
4491
|
const clients = /* @__PURE__ */ new Map();
|
|
4489
4492
|
(_a = (server || ctx.server).httpServer) == null ? void 0 : _a.on("upgrade", (request, socket, head) => {
|
|
@@ -4501,8 +4504,8 @@ function setup(ctx, server) {
|
|
|
4501
4504
|
const rpc = createBirpc(
|
|
4502
4505
|
{
|
|
4503
4506
|
async onDone(testId) {
|
|
4504
|
-
var _a2
|
|
4505
|
-
|
|
4507
|
+
var _a2;
|
|
4508
|
+
return (_a2 = ctx.state.browserTestPromises.get(testId)) == null ? void 0 : _a2.resolve(true);
|
|
4506
4509
|
},
|
|
4507
4510
|
async onCollected(files) {
|
|
4508
4511
|
ctx.state.collectFiles(files);
|
|
@@ -4512,15 +4515,25 @@ function setup(ctx, server) {
|
|
|
4512
4515
|
ctx.state.updateTasks(packs);
|
|
4513
4516
|
await ctx.report("onTaskUpdate", packs);
|
|
4514
4517
|
},
|
|
4518
|
+
onAfterSuiteRun(meta) {
|
|
4519
|
+
var _a2;
|
|
4520
|
+
(_a2 = ctx.coverageProvider) == null ? void 0 : _a2.onAfterSuiteRun(meta);
|
|
4521
|
+
},
|
|
4515
4522
|
getFiles() {
|
|
4516
4523
|
return ctx.state.getFiles();
|
|
4517
4524
|
},
|
|
4518
4525
|
getPaths() {
|
|
4519
4526
|
return ctx.state.getPaths();
|
|
4520
4527
|
},
|
|
4528
|
+
sendLog(log) {
|
|
4529
|
+
return ctx.report("onUserConsoleLog", log);
|
|
4530
|
+
},
|
|
4521
4531
|
resolveSnapshotPath(testPath) {
|
|
4522
4532
|
return ctx.snapshot.resolvePath(testPath);
|
|
4523
4533
|
},
|
|
4534
|
+
resolveSnapshotRawPath(testPath, rawPath) {
|
|
4535
|
+
return ctx.snapshot.resolveRawPath(testPath, rawPath);
|
|
4536
|
+
},
|
|
4524
4537
|
removeFile(id) {
|
|
4525
4538
|
return promises.unlink(id);
|
|
4526
4539
|
},
|
|
@@ -4597,10 +4610,11 @@ class WebSocketReporter {
|
|
|
4597
4610
|
return;
|
|
4598
4611
|
packs.forEach(([, result]) => {
|
|
4599
4612
|
var _a;
|
|
4600
|
-
if (result == null ? void 0 : result.error)
|
|
4613
|
+
if ((result == null ? void 0 : result.error) && !isPrimitive(result.error))
|
|
4601
4614
|
result.error.stacks = parseErrorStacktrace(result.error);
|
|
4602
4615
|
(_a = result == null ? void 0 : result.errors) == null ? void 0 : _a.forEach((error) => {
|
|
4603
|
-
|
|
4616
|
+
if (!isPrimitive(error))
|
|
4617
|
+
error.stacks = parseErrorStacktrace(error);
|
|
4604
4618
|
});
|
|
4605
4619
|
});
|
|
4606
4620
|
this.clients.forEach((client) => {
|
|
@@ -1,56 +1,57 @@
|
|
|
1
1
|
import require$$0 from 'fs';
|
|
2
|
-
import
|
|
2
|
+
import p from 'path';
|
|
3
3
|
import require$$0$1 from 'util';
|
|
4
4
|
import require$$0$3 from 'child_process';
|
|
5
|
-
import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.
|
|
6
|
-
import { o as onetime$1 } from './
|
|
5
|
+
import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.c1e09929.js';
|
|
6
|
+
import { o as onetime$1 } from './vendor-cli-api.c04eaa34.js';
|
|
7
7
|
import require$$0$2 from 'os';
|
|
8
8
|
import 'node:buffer';
|
|
9
9
|
import 'node:path';
|
|
10
10
|
import 'node:child_process';
|
|
11
11
|
import 'node:process';
|
|
12
|
-
import './vendor-_commonjsHelpers.
|
|
12
|
+
import './vendor-_commonjsHelpers.76cdd49e.js';
|
|
13
13
|
import 'node:url';
|
|
14
14
|
import 'node:os';
|
|
15
15
|
import 'assert';
|
|
16
16
|
import 'events';
|
|
17
|
+
import 'node:fs';
|
|
17
18
|
import 'buffer';
|
|
18
19
|
import 'stream';
|
|
20
|
+
import 'node:util';
|
|
19
21
|
import 'pathe';
|
|
20
|
-
import './
|
|
21
|
-
import './
|
|
22
|
-
import '
|
|
23
|
-
import './chunk-env-node.affdd278.js';
|
|
22
|
+
import './vendor-constants.538d9b49.js';
|
|
23
|
+
import './vendor-coverage.a585b712.js';
|
|
24
|
+
import './vendor-index.75f2b63d.js';
|
|
24
25
|
import 'node:console';
|
|
26
|
+
import 'local-pkg';
|
|
25
27
|
import 'picocolors';
|
|
26
|
-
import './
|
|
28
|
+
import './vendor-index.fad2598b.js';
|
|
27
29
|
import 'std-env';
|
|
28
30
|
import '@vitest/runner/utils';
|
|
29
31
|
import '@vitest/utils';
|
|
32
|
+
import './vendor-global.6795f91f.js';
|
|
30
33
|
import 'vite';
|
|
31
|
-
import 'node:fs';
|
|
32
34
|
import 'vite-node/utils';
|
|
33
35
|
import 'vite-node/client';
|
|
34
|
-
import '
|
|
35
|
-
import '
|
|
36
|
-
import 'module';
|
|
37
|
-
import 'acorn';
|
|
38
|
-
import 'acorn-walk';
|
|
39
|
-
import './chunk-utils-base.81f83dbd.js';
|
|
40
|
-
import 'crypto';
|
|
41
|
-
import './chunk-paths.e36446b4.js';
|
|
36
|
+
import '@vitest/snapshot/manager';
|
|
37
|
+
import './vendor-paths.84fc7a99.js';
|
|
42
38
|
import 'node:v8';
|
|
43
|
-
import './vendor-index.
|
|
39
|
+
import './vendor-index.4f82d248.js';
|
|
44
40
|
import 'node:worker_threads';
|
|
45
41
|
import 'tinypool';
|
|
46
|
-
import 'perf_hooks';
|
|
47
|
-
import './
|
|
48
|
-
import '@vitest/utils/diff';
|
|
49
|
-
import 'vite-node/server';
|
|
50
|
-
import './vendor-magic-string.es.b3bc5745.js';
|
|
42
|
+
import 'node:perf_hooks';
|
|
43
|
+
import './vendor-tasks.042d6084.js';
|
|
51
44
|
import 'node:module';
|
|
52
45
|
import 'node:crypto';
|
|
46
|
+
import 'node:fs/promises';
|
|
47
|
+
import 'source-map';
|
|
48
|
+
import 'module';
|
|
49
|
+
import 'acorn';
|
|
50
|
+
import 'acorn-walk';
|
|
51
|
+
import 'magic-string';
|
|
53
52
|
import 'strip-literal';
|
|
53
|
+
import 'vite-node/server';
|
|
54
|
+
import 'node:readline';
|
|
54
55
|
import 'readline';
|
|
55
56
|
|
|
56
57
|
var findUp$1 = {exports: {}};
|
|
@@ -69,7 +70,7 @@ class Node {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
|
|
73
|
+
let Queue$1 = class Queue {
|
|
73
74
|
// TODO: Use private class fields when targeting Node.js 12.
|
|
74
75
|
// #_head;
|
|
75
76
|
// #_tail;
|
|
@@ -122,7 +123,7 @@ class Queue$1 {
|
|
|
122
123
|
current = current.next;
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
|
-
}
|
|
126
|
+
};
|
|
126
127
|
|
|
127
128
|
var yoctoQueue = Queue$1;
|
|
128
129
|
|
|
@@ -247,7 +248,7 @@ const pLocate$1 = async (iterable, tester, options) => {
|
|
|
247
248
|
|
|
248
249
|
var pLocate_1 = pLocate$1;
|
|
249
250
|
|
|
250
|
-
const path$1 =
|
|
251
|
+
const path$1 = p;
|
|
251
252
|
const fs$1 = require$$0;
|
|
252
253
|
const {promisify: promisify$1} = require$$0$1;
|
|
253
254
|
const pLocate = pLocate_1;
|
|
@@ -341,7 +342,7 @@ pathExists.exports.sync = path => {
|
|
|
341
342
|
};
|
|
342
343
|
|
|
343
344
|
(function (module) {
|
|
344
|
-
const path =
|
|
345
|
+
const path = p;
|
|
345
346
|
const locatePath$1 = locatePath.exports;
|
|
346
347
|
const pathExists$1 = pathExists.exports;
|
|
347
348
|
|
|
@@ -453,7 +454,7 @@ var stripFinalNewline$1 = input => {
|
|
|
453
454
|
var npmRunPath$1 = {exports: {}};
|
|
454
455
|
|
|
455
456
|
(function (module) {
|
|
456
|
-
const path =
|
|
457
|
+
const path = p;
|
|
457
458
|
const pathKey$1 = pathKey.exports;
|
|
458
459
|
|
|
459
460
|
const npmRunPath = options => {
|
|
@@ -1383,7 +1384,7 @@ var command = {
|
|
|
1383
1384
|
parseCommand: parseCommand$1
|
|
1384
1385
|
};
|
|
1385
1386
|
|
|
1386
|
-
const path =
|
|
1387
|
+
const path = p;
|
|
1387
1388
|
const childProcess = require$$0$3;
|
|
1388
1389
|
const crossSpawn = crossSpawn$1.exports;
|
|
1389
1390
|
const stripFinalNewline = stripFinalNewline$1;
|
|
@@ -1665,7 +1666,7 @@ async function detectPackageManager(cwd = process.cwd()) {
|
|
|
1665
1666
|
const lockPath = await findUp(Object.keys(LOCKS), { cwd });
|
|
1666
1667
|
let packageJsonPath;
|
|
1667
1668
|
if (lockPath)
|
|
1668
|
-
packageJsonPath =
|
|
1669
|
+
packageJsonPath = p.resolve(lockPath, "../package.json");
|
|
1669
1670
|
else
|
|
1670
1671
|
packageJsonPath = await findUp("package.json", { cwd });
|
|
1671
1672
|
if (packageJsonPath && require$$0.existsSync(packageJsonPath)) {
|
|
@@ -1686,7 +1687,7 @@ async function detectPackageManager(cwd = process.cwd()) {
|
|
|
1686
1687
|
}
|
|
1687
1688
|
}
|
|
1688
1689
|
if (!agent && lockPath)
|
|
1689
|
-
agent = LOCKS[
|
|
1690
|
+
agent = LOCKS[p.basename(lockPath)];
|
|
1690
1691
|
return agent;
|
|
1691
1692
|
}
|
|
1692
1693
|
async function installPackage(names, options = {}) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { g as globalApis } from './vendor-constants.538d9b49.js';
|
|
2
|
+
import { i as index } from './vendor-index.81b9e499.js';
|
|
3
|
+
import '@vitest/runner';
|
|
4
|
+
import './vendor-vi.a3ff54b1.js';
|
|
5
|
+
import '@vitest/runner/utils';
|
|
6
|
+
import '@vitest/utils';
|
|
7
|
+
import './vendor-index.fad2598b.js';
|
|
8
|
+
import 'pathe';
|
|
9
|
+
import 'std-env';
|
|
10
|
+
import './vendor-global.6795f91f.js';
|
|
11
|
+
import 'chai';
|
|
12
|
+
import './vendor-_commonjsHelpers.76cdd49e.js';
|
|
13
|
+
import '@vitest/expect';
|
|
14
|
+
import '@vitest/snapshot';
|
|
15
|
+
import './vendor-tasks.042d6084.js';
|
|
16
|
+
import 'util';
|
|
17
|
+
import '@vitest/spy';
|
|
18
|
+
import './vendor-run-once.69ce7172.js';
|
|
19
|
+
|
|
20
|
+
function registerApiGlobally() {
|
|
21
|
+
globalApis.forEach((api) => {
|
|
22
|
+
globalThis[api] = index[api];
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { registerApiGlobally };
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { resolve } from 'pathe';
|
|
2
|
-
import { e as execa } from './vendor-index.
|
|
2
|
+
import { e as execa } from './vendor-index.c1e09929.js';
|
|
3
3
|
import 'node:buffer';
|
|
4
4
|
import 'node:path';
|
|
5
5
|
import 'node:child_process';
|
|
6
6
|
import 'node:process';
|
|
7
7
|
import 'child_process';
|
|
8
8
|
import 'path';
|
|
9
|
-
import './vendor-_commonjsHelpers.
|
|
9
|
+
import './vendor-_commonjsHelpers.76cdd49e.js';
|
|
10
10
|
import 'fs';
|
|
11
11
|
import 'node:url';
|
|
12
12
|
import 'node:os';
|
|
13
13
|
import 'assert';
|
|
14
14
|
import 'events';
|
|
15
|
+
import 'node:fs';
|
|
15
16
|
import 'buffer';
|
|
16
17
|
import 'stream';
|
|
17
18
|
import 'util';
|
|
19
|
+
import 'node:util';
|
|
18
20
|
|
|
19
21
|
class VitestGit {
|
|
20
22
|
constructor(cwd) {
|
package/dist/cli-wrapper.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { fileURLToPath } from 'url';
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
2
|
import c from 'picocolors';
|
|
3
|
-
import { e as execa } from './vendor-index.
|
|
4
|
-
import { E as EXIT_CODE_RESTART } from './
|
|
3
|
+
import { e as execa } from './vendor-index.c1e09929.js';
|
|
4
|
+
import { E as EXIT_CODE_RESTART } from './vendor-constants.538d9b49.js';
|
|
5
5
|
import 'node:buffer';
|
|
6
6
|
import 'node:path';
|
|
7
7
|
import 'node:child_process';
|
|
8
8
|
import 'node:process';
|
|
9
9
|
import 'child_process';
|
|
10
10
|
import 'path';
|
|
11
|
-
import './vendor-_commonjsHelpers.
|
|
11
|
+
import './vendor-_commonjsHelpers.76cdd49e.js';
|
|
12
12
|
import 'fs';
|
|
13
|
-
import 'node:url';
|
|
14
13
|
import 'node:os';
|
|
15
14
|
import 'assert';
|
|
16
15
|
import 'events';
|
|
16
|
+
import 'node:fs';
|
|
17
17
|
import 'buffer';
|
|
18
18
|
import 'stream';
|
|
19
19
|
import 'util';
|
|
20
|
+
import 'node:util';
|
|
20
21
|
|
|
21
22
|
const ENTRY = new URL("./cli.js", import.meta.url);
|
|
22
23
|
const NODE_ARGS = [
|