vitest 2.0.0-beta.9 → 2.0.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 +1 -22
- package/dist/browser.d.ts +24 -7
- package/dist/browser.js +5 -19
- package/dist/chunks/browser-creator.DSqYDthP.js +673 -0
- package/dist/chunks/{environments-node.39w4gmlF.js → environments-node.XE5FbRPQ.js} +1 -1
- package/dist/chunks/{integrations-globals.BK0Cn4q1.js → integrations-globals.CzYWb38r.js} +10 -9
- package/dist/chunks/{node-git.CCI8evVZ.js → node-git.ZtkbKc8u.js} +14 -15
- package/dist/chunks/{runtime-console.DiVMr5d4.js → runtime-console.O41g23Zj.js} +26 -11
- package/dist/chunks/{runtime-runBaseTests.C-Bkopka.js → runtime-runBaseTests.DX3h28Mp.js} +47 -34
- package/dist/cli.js +3 -3
- package/dist/config.cjs +48 -23
- package/dist/config.d.ts +2 -1
- package/dist/config.js +48 -24
- package/dist/coverage.d.ts +6 -4
- package/dist/coverage.js +102 -38
- package/dist/environments.d.ts +2 -1
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +4 -3
- package/dist/execute.js +2 -2
- package/dist/index.d.ts +1437 -7
- package/dist/index.js +10 -9
- package/dist/node.d.ts +34 -7
- package/dist/node.js +31 -20
- package/dist/path.js +4 -1
- package/dist/{reporters-DaDey3o0.d.ts → reporters-DrhyxxXt.d.ts} +213 -206
- package/dist/reporters.d.ts +2 -1
- package/dist/reporters.js +8 -8
- package/dist/runners.d.ts +3 -1
- package/dist/runners.js +100 -61
- package/dist/snapshot.js +2 -2
- package/dist/{suite-BHSUxUib.d.ts → suite-DCPwkk7G.d.ts} +1 -1
- package/dist/suite.d.ts +3 -2
- package/dist/suite.js +3 -3
- package/dist/utils.d.ts +1 -5
- package/dist/utils.js +1 -6
- package/dist/vendor/{base._gnK9Slw.js → base.CTYV4Gnz.js} +24 -17
- package/dist/vendor/{base.D4XK-wRp.js → base.CdA1i5tB.js} +6 -4
- package/dist/vendor/{benchmark.BNLebNi5.js → benchmark.B6pblCp2.js} +13 -14
- package/dist/vendor/{cac.DCg3FnEs.js → cac.5nBDv26-.js} +142 -47
- package/dist/vendor/{cli-api.LMvYagQ5.js → cli-api.BT4NJtxX.js} +4162 -9514
- package/dist/vendor/{constants.TCjCaw2D.js → constants.CsnA4eRy.js} +5 -23
- package/dist/vendor/{coverage.ChSqD-qS.js → coverage.BhYSDdTT.js} +27 -11
- package/dist/vendor/{date.BKM1wewY.js → date.W2xKR2qe.js} +5 -3
- package/dist/vendor/env.2ltrQNq0.js +8 -0
- package/dist/vendor/{execute.BHj6OMh4.js → execute.Dx503nGn.js} +186 -64
- package/dist/vendor/{index.TBU3GqRP.js → index.3x3MdmUV.js} +1075 -526
- package/dist/vendor/{index._7XLd8Kd.js → index.BJmtb_7W.js} +3 -2
- package/dist/vendor/{index.DP-km6lF.js → index.BMmMjLIQ.js} +64 -51
- package/dist/vendor/{index.DHRpy7zp.js → index.CROIsoiT.js} +18 -10
- package/dist/vendor/{index.DeR1hhfY.js → index.D4nqnQWz.js} +71 -74
- package/dist/vendor/index.D6GZqexG.js +6575 -0
- package/dist/vendor/{index.DwR86H5i.js → index.Hqvcg1pf.js} +4 -27
- package/dist/vendor/{rpc.DRDE9Pu1.js → rpc.BGx7q_k2.js} +30 -19
- package/dist/vendor/run-once.Db8Hgq9X.js +28 -0
- package/dist/vendor/{setup-common.BhJvzjns.js → setup-common.yHaxjRhz.js} +30 -15
- package/dist/vendor/spy.Cf_4R5Oe.js +22 -0
- package/dist/vendor/{tasks.WC7M-K-v.js → tasks.DhVtQBtW.js} +3 -1
- package/dist/vendor/{utils.YuQ3LT2a.js → utils.BVMrsl6E.js} +55 -30
- package/dist/vendor/{utils.CUjzkRH7.js → utils.DkxLWvS1.js} +12 -5
- package/dist/vendor/{vi.C6AfDXK6.js → vi.DXACdGTu.js} +269 -136
- package/dist/vendor/{vm.Ow-X2mkS.js → vm.BrDS6p7h.js} +157 -90
- package/dist/worker.js +41 -18
- package/dist/workers/forks.js +12 -6
- package/dist/workers/runVmTests.js +22 -16
- package/dist/workers/threads.js +8 -5
- package/dist/workers/vmForks.js +15 -9
- package/dist/workers/vmThreads.js +11 -8
- package/dist/workers.d.ts +8 -5
- package/dist/workers.js +11 -11
- package/package.json +22 -21
- package/suppress-warnings.cjs +2 -4
- package/dist/index-B0dCycbN.d.ts +0 -1571
- package/dist/vendor/env.bmJgw1qP.js +0 -7
|
@@ -2,7 +2,7 @@ import { relative } from 'pathe';
|
|
|
2
2
|
import '@vitest/runner/utils';
|
|
3
3
|
import '@vitest/utils';
|
|
4
4
|
import { g as getWorkerState } from './global.7bFbnyXl.js';
|
|
5
|
-
import './env.
|
|
5
|
+
import './env.2ltrQNq0.js';
|
|
6
6
|
|
|
7
7
|
function getRunMode() {
|
|
8
8
|
return getWorkerState().config.mode;
|
|
@@ -13,8 +13,9 @@ function isRunningInBenchmark() {
|
|
|
13
13
|
const relativePath = relative;
|
|
14
14
|
function removeUndefinedValues(obj) {
|
|
15
15
|
for (const key in Object.keys(obj)) {
|
|
16
|
-
if (obj[key] === void 0)
|
|
16
|
+
if (obj[key] === void 0) {
|
|
17
17
|
delete obj[key];
|
|
18
|
+
}
|
|
18
19
|
}
|
|
19
20
|
return obj;
|
|
20
21
|
}
|
|
@@ -37,7 +37,7 @@ var utils$8 = {};
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
exports.escapeNode = (block, n = 0, type) => {
|
|
40
|
-
|
|
40
|
+
const node = block.nodes[n];
|
|
41
41
|
if (!node) return;
|
|
42
42
|
|
|
43
43
|
if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
|
|
@@ -106,13 +106,23 @@ var utils$8 = {};
|
|
|
106
106
|
|
|
107
107
|
exports.flatten = (...args) => {
|
|
108
108
|
const result = [];
|
|
109
|
+
|
|
109
110
|
const flat = arr => {
|
|
110
111
|
for (let i = 0; i < arr.length; i++) {
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
const ele = arr[i];
|
|
113
|
+
|
|
114
|
+
if (Array.isArray(ele)) {
|
|
115
|
+
flat(ele);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (ele !== undefined) {
|
|
120
|
+
result.push(ele);
|
|
121
|
+
}
|
|
113
122
|
}
|
|
114
123
|
return result;
|
|
115
124
|
};
|
|
125
|
+
|
|
116
126
|
flat(args);
|
|
117
127
|
return result;
|
|
118
128
|
};
|
|
@@ -121,9 +131,9 @@ var utils$8 = {};
|
|
|
121
131
|
const utils$7 = utils$8;
|
|
122
132
|
|
|
123
133
|
var stringify$4 = (ast, options = {}) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
134
|
+
const stringify = (node, parent = {}) => {
|
|
135
|
+
const invalidBlock = options.escapeInvalid && utils$7.isInvalidBrace(parent);
|
|
136
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
127
137
|
let output = '';
|
|
128
138
|
|
|
129
139
|
if (node.value) {
|
|
@@ -138,7 +148,7 @@ var stringify$4 = (ast, options = {}) => {
|
|
|
138
148
|
}
|
|
139
149
|
|
|
140
150
|
if (node.nodes) {
|
|
141
|
-
for (
|
|
151
|
+
for (const child of node.nodes) {
|
|
142
152
|
output += stringify(child);
|
|
143
153
|
}
|
|
144
154
|
}
|
|
@@ -512,7 +522,7 @@ const toMaxLen = (input, maxLength) => {
|
|
|
512
522
|
return negative ? ('-' + input) : input;
|
|
513
523
|
};
|
|
514
524
|
|
|
515
|
-
const toSequence = (parts, options) => {
|
|
525
|
+
const toSequence = (parts, options, maxLen) => {
|
|
516
526
|
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
517
527
|
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
518
528
|
|
|
@@ -522,11 +532,11 @@ const toSequence = (parts, options) => {
|
|
|
522
532
|
let result;
|
|
523
533
|
|
|
524
534
|
if (parts.positives.length) {
|
|
525
|
-
positives = parts.positives.join('|');
|
|
535
|
+
positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|');
|
|
526
536
|
}
|
|
527
537
|
|
|
528
538
|
if (parts.negatives.length) {
|
|
529
|
-
negatives = `-(${prefix}${parts.negatives.join('|')})`;
|
|
539
|
+
negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`;
|
|
530
540
|
}
|
|
531
541
|
|
|
532
542
|
if (positives && negatives) {
|
|
@@ -624,7 +634,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
|
|
|
624
634
|
|
|
625
635
|
if (options.toRegex === true) {
|
|
626
636
|
return step > 1
|
|
627
|
-
? toSequence(parts, options)
|
|
637
|
+
? toSequence(parts, options, maxLen)
|
|
628
638
|
: toRegex(range, null, { wrap: false, ...options });
|
|
629
639
|
}
|
|
630
640
|
|
|
@@ -636,7 +646,6 @@ const fillLetters = (start, end, step = 1, options = {}) => {
|
|
|
636
646
|
return invalidRange(start, end, options);
|
|
637
647
|
}
|
|
638
648
|
|
|
639
|
-
|
|
640
649
|
let format = options.transform || (val => String.fromCharCode(val));
|
|
641
650
|
let a = `${start}`.charCodeAt(0);
|
|
642
651
|
let b = `${end}`.charCodeAt(0);
|
|
@@ -704,30 +713,32 @@ const fill$1 = fillRange;
|
|
|
704
713
|
const utils$6 = utils$8;
|
|
705
714
|
|
|
706
715
|
const compile$1 = (ast, options = {}) => {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
716
|
+
const walk = (node, parent = {}) => {
|
|
717
|
+
const invalidBlock = utils$6.isInvalidBrace(parent);
|
|
718
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
719
|
+
const invalid = invalidBlock === true || invalidNode === true;
|
|
720
|
+
const prefix = options.escapeInvalid === true ? '\\' : '';
|
|
712
721
|
let output = '';
|
|
713
722
|
|
|
714
723
|
if (node.isOpen === true) {
|
|
715
724
|
return prefix + node.value;
|
|
716
725
|
}
|
|
726
|
+
|
|
717
727
|
if (node.isClose === true) {
|
|
728
|
+
console.log('node.isClose', prefix, node.value);
|
|
718
729
|
return prefix + node.value;
|
|
719
730
|
}
|
|
720
731
|
|
|
721
732
|
if (node.type === 'open') {
|
|
722
|
-
return invalid ?
|
|
733
|
+
return invalid ? prefix + node.value : '(';
|
|
723
734
|
}
|
|
724
735
|
|
|
725
736
|
if (node.type === 'close') {
|
|
726
|
-
return invalid ?
|
|
737
|
+
return invalid ? prefix + node.value : ')';
|
|
727
738
|
}
|
|
728
739
|
|
|
729
740
|
if (node.type === 'comma') {
|
|
730
|
-
return node.prev.type === 'comma' ? '' :
|
|
741
|
+
return node.prev.type === 'comma' ? '' : invalid ? node.value : '|';
|
|
731
742
|
}
|
|
732
743
|
|
|
733
744
|
if (node.value) {
|
|
@@ -735,8 +746,8 @@ const compile$1 = (ast, options = {}) => {
|
|
|
735
746
|
}
|
|
736
747
|
|
|
737
748
|
if (node.nodes && node.ranges > 0) {
|
|
738
|
-
|
|
739
|
-
|
|
749
|
+
const args = utils$6.reduce(node.nodes);
|
|
750
|
+
const range = fill$1(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
|
|
740
751
|
|
|
741
752
|
if (range.length !== 0) {
|
|
742
753
|
return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
@@ -744,10 +755,11 @@ const compile$1 = (ast, options = {}) => {
|
|
|
744
755
|
}
|
|
745
756
|
|
|
746
757
|
if (node.nodes) {
|
|
747
|
-
for (
|
|
758
|
+
for (const child of node.nodes) {
|
|
748
759
|
output += walk(child, node);
|
|
749
760
|
}
|
|
750
761
|
}
|
|
762
|
+
|
|
751
763
|
return output;
|
|
752
764
|
};
|
|
753
765
|
|
|
@@ -761,7 +773,7 @@ const stringify$2 = stringify$4;
|
|
|
761
773
|
const utils$5 = utils$8;
|
|
762
774
|
|
|
763
775
|
const append = (queue = '', stash = '', enclose = false) => {
|
|
764
|
-
|
|
776
|
+
const result = [];
|
|
765
777
|
|
|
766
778
|
queue = [].concat(queue);
|
|
767
779
|
stash = [].concat(stash);
|
|
@@ -771,15 +783,15 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
771
783
|
return enclose ? utils$5.flatten(stash).map(ele => `{${ele}}`) : stash;
|
|
772
784
|
}
|
|
773
785
|
|
|
774
|
-
for (
|
|
786
|
+
for (const item of queue) {
|
|
775
787
|
if (Array.isArray(item)) {
|
|
776
|
-
for (
|
|
788
|
+
for (const value of item) {
|
|
777
789
|
result.push(append(value, stash, enclose));
|
|
778
790
|
}
|
|
779
791
|
} else {
|
|
780
792
|
for (let ele of stash) {
|
|
781
793
|
if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
|
|
782
|
-
result.push(Array.isArray(ele) ? append(item, ele, enclose) :
|
|
794
|
+
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
|
783
795
|
}
|
|
784
796
|
}
|
|
785
797
|
}
|
|
@@ -787,9 +799,9 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
787
799
|
};
|
|
788
800
|
|
|
789
801
|
const expand$1 = (ast, options = {}) => {
|
|
790
|
-
|
|
802
|
+
const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
|
|
791
803
|
|
|
792
|
-
|
|
804
|
+
const walk = (node, parent = {}) => {
|
|
793
805
|
node.queue = [];
|
|
794
806
|
|
|
795
807
|
let p = parent;
|
|
@@ -811,7 +823,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
811
823
|
}
|
|
812
824
|
|
|
813
825
|
if (node.nodes && node.ranges > 0) {
|
|
814
|
-
|
|
826
|
+
const args = utils$5.reduce(node.nodes);
|
|
815
827
|
|
|
816
828
|
if (utils$5.exceedsLimit(...args, options.step, rangeLimit)) {
|
|
817
829
|
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
|
|
@@ -827,7 +839,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
827
839
|
return;
|
|
828
840
|
}
|
|
829
841
|
|
|
830
|
-
|
|
842
|
+
const enclose = utils$5.encloseBrace(node);
|
|
831
843
|
let queue = node.queue;
|
|
832
844
|
let block = node;
|
|
833
845
|
|
|
@@ -837,7 +849,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
837
849
|
}
|
|
838
850
|
|
|
839
851
|
for (let i = 0; i < node.nodes.length; i++) {
|
|
840
|
-
|
|
852
|
+
const child = node.nodes[i];
|
|
841
853
|
|
|
842
854
|
if (child.type === 'comma' && node.type === 'brace') {
|
|
843
855
|
if (i === 1) queue.push('');
|
|
@@ -869,7 +881,7 @@ const expand$1 = (ast, options = {}) => {
|
|
|
869
881
|
var expand_1 = expand$1;
|
|
870
882
|
|
|
871
883
|
var constants$3 = {
|
|
872
|
-
MAX_LENGTH:
|
|
884
|
+
MAX_LENGTH: 10000,
|
|
873
885
|
|
|
874
886
|
// Digits
|
|
875
887
|
CHAR_0: '0', /* 0 */
|
|
@@ -957,18 +969,18 @@ const parse$3 = (input, options = {}) => {
|
|
|
957
969
|
throw new TypeError('Expected a string');
|
|
958
970
|
}
|
|
959
971
|
|
|
960
|
-
|
|
961
|
-
|
|
972
|
+
const opts = options || {};
|
|
973
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
|
|
962
974
|
if (input.length > max) {
|
|
963
975
|
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
964
976
|
}
|
|
965
977
|
|
|
966
|
-
|
|
967
|
-
|
|
978
|
+
const ast = { type: 'root', input, nodes: [] };
|
|
979
|
+
const stack = [ast];
|
|
968
980
|
let block = ast;
|
|
969
981
|
let prev = ast;
|
|
970
982
|
let brackets = 0;
|
|
971
|
-
|
|
983
|
+
const length = input.length;
|
|
972
984
|
let index = 0;
|
|
973
985
|
let depth = 0;
|
|
974
986
|
let value;
|
|
@@ -1033,6 +1045,7 @@ const parse$3 = (input, options = {}) => {
|
|
|
1033
1045
|
|
|
1034
1046
|
if (value === CHAR_LEFT_SQUARE_BRACKET$1) {
|
|
1035
1047
|
brackets++;
|
|
1048
|
+
|
|
1036
1049
|
let next;
|
|
1037
1050
|
|
|
1038
1051
|
while (index < length && (next = advance())) {
|
|
@@ -1088,7 +1101,7 @@ const parse$3 = (input, options = {}) => {
|
|
|
1088
1101
|
*/
|
|
1089
1102
|
|
|
1090
1103
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
1091
|
-
|
|
1104
|
+
const open = value;
|
|
1092
1105
|
let next;
|
|
1093
1106
|
|
|
1094
1107
|
if (options.keepQuotes !== true) {
|
|
@@ -1120,8 +1133,8 @@ const parse$3 = (input, options = {}) => {
|
|
|
1120
1133
|
if (value === CHAR_LEFT_CURLY_BRACE$1) {
|
|
1121
1134
|
depth++;
|
|
1122
1135
|
|
|
1123
|
-
|
|
1124
|
-
|
|
1136
|
+
const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
|
|
1137
|
+
const brace = {
|
|
1125
1138
|
type: 'brace',
|
|
1126
1139
|
open: true,
|
|
1127
1140
|
close: false,
|
|
@@ -1148,7 +1161,7 @@ const parse$3 = (input, options = {}) => {
|
|
|
1148
1161
|
continue;
|
|
1149
1162
|
}
|
|
1150
1163
|
|
|
1151
|
-
|
|
1164
|
+
const type = 'close';
|
|
1152
1165
|
block = stack.pop();
|
|
1153
1166
|
block.close = true;
|
|
1154
1167
|
|
|
@@ -1166,7 +1179,7 @@ const parse$3 = (input, options = {}) => {
|
|
|
1166
1179
|
if (value === CHAR_COMMA$1 && depth > 0) {
|
|
1167
1180
|
if (block.ranges > 0) {
|
|
1168
1181
|
block.ranges = 0;
|
|
1169
|
-
|
|
1182
|
+
const open = block.nodes.shift();
|
|
1170
1183
|
block.nodes = [open, { type: 'text', value: stringify$1(block) }];
|
|
1171
1184
|
}
|
|
1172
1185
|
|
|
@@ -1180,7 +1193,7 @@ const parse$3 = (input, options = {}) => {
|
|
|
1180
1193
|
*/
|
|
1181
1194
|
|
|
1182
1195
|
if (value === CHAR_DOT$1 && depth > 0 && block.commas === 0) {
|
|
1183
|
-
|
|
1196
|
+
const siblings = block.nodes;
|
|
1184
1197
|
|
|
1185
1198
|
if (depth === 0 || siblings.length === 0) {
|
|
1186
1199
|
push({ type: 'text', value });
|
|
@@ -1207,7 +1220,7 @@ const parse$3 = (input, options = {}) => {
|
|
|
1207
1220
|
if (prev.type === 'range') {
|
|
1208
1221
|
siblings.pop();
|
|
1209
1222
|
|
|
1210
|
-
|
|
1223
|
+
const before = siblings[siblings.length - 1];
|
|
1211
1224
|
before.value += prev.value + value;
|
|
1212
1225
|
prev = before;
|
|
1213
1226
|
block.ranges--;
|
|
@@ -1240,8 +1253,8 @@ const parse$3 = (input, options = {}) => {
|
|
|
1240
1253
|
});
|
|
1241
1254
|
|
|
1242
1255
|
// get the location of the block on parent.nodes (block's siblings)
|
|
1243
|
-
|
|
1244
|
-
|
|
1256
|
+
const parent = stack[stack.length - 1];
|
|
1257
|
+
const index = parent.nodes.indexOf(block);
|
|
1245
1258
|
// replace the (invalid) block with it's nodes
|
|
1246
1259
|
parent.nodes.splice(index, 1, ...block.nodes);
|
|
1247
1260
|
}
|
|
@@ -1276,8 +1289,8 @@ const braces$1 = (input, options = {}) => {
|
|
|
1276
1289
|
let output = [];
|
|
1277
1290
|
|
|
1278
1291
|
if (Array.isArray(input)) {
|
|
1279
|
-
for (
|
|
1280
|
-
|
|
1292
|
+
for (const pattern of input) {
|
|
1293
|
+
const result = braces$1.create(pattern, options);
|
|
1281
1294
|
if (Array.isArray(result)) {
|
|
1282
1295
|
output.push(...result);
|
|
1283
1296
|
} else {
|
|
@@ -1411,7 +1424,7 @@ braces$1.create = (input, options = {}) => {
|
|
|
1411
1424
|
return [input];
|
|
1412
1425
|
}
|
|
1413
1426
|
|
|
1414
|
-
|
|
1427
|
+
return options.expand !== true
|
|
1415
1428
|
? braces$1.compile(input, options)
|
|
1416
1429
|
: braces$1.expand(input, options);
|
|
1417
1430
|
};
|
|
@@ -3959,4 +3972,4 @@ var micromatch_1 = micromatch;
|
|
|
3959
3972
|
|
|
3960
3973
|
var mm = /*@__PURE__*/getDefaultExportFromCjs(micromatch_1);
|
|
3961
3974
|
|
|
3962
|
-
export {
|
|
3975
|
+
export { braces_1 as b, mm as m, picomatch$1 as p, utils$4 as u };
|
|
@@ -2,9 +2,9 @@ import * as chai from 'chai';
|
|
|
2
2
|
import { resolve } from 'pathe';
|
|
3
3
|
import { distDir } from '../path.js';
|
|
4
4
|
import { g as getWorkerState } from './global.7bFbnyXl.js';
|
|
5
|
-
import { r as rpc } from './rpc.
|
|
6
|
-
import { t as takeCoverageInsideWorker } from './coverage.
|
|
7
|
-
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.
|
|
5
|
+
import { r as rpc } from './rpc.BGx7q_k2.js';
|
|
6
|
+
import { t as takeCoverageInsideWorker } from './coverage.BhYSDdTT.js';
|
|
7
|
+
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.yHaxjRhz.js';
|
|
8
8
|
|
|
9
9
|
function setupChaiConfig(config) {
|
|
10
10
|
Object.assign(chai.config, config);
|
|
@@ -12,12 +12,15 @@ function setupChaiConfig(config) {
|
|
|
12
12
|
|
|
13
13
|
async function resolveSnapshotEnvironment(config, executor) {
|
|
14
14
|
if (!config.snapshotEnvironment) {
|
|
15
|
-
const { VitestNodeSnapshotEnvironment } = await import('../chunks/environments-node.
|
|
15
|
+
const { VitestNodeSnapshotEnvironment } = await import('../chunks/environments-node.XE5FbRPQ.js');
|
|
16
16
|
return new VitestNodeSnapshotEnvironment();
|
|
17
17
|
}
|
|
18
18
|
const mod = await executor.executeId(config.snapshotEnvironment);
|
|
19
|
-
if (typeof mod.default !== "object" || !mod.default)
|
|
20
|
-
throw new Error(
|
|
19
|
+
if (typeof mod.default !== "object" || !mod.default) {
|
|
20
|
+
throw new Error(
|
|
21
|
+
"Snapshot environment module must have a default export object with a shape of `SnapshotEnvironment`"
|
|
22
|
+
);
|
|
23
|
+
}
|
|
21
24
|
return mod.default;
|
|
22
25
|
}
|
|
23
26
|
|
|
@@ -28,8 +31,11 @@ async function getTestRunnerConstructor(config, executor) {
|
|
|
28
31
|
return config.mode === "test" ? VitestTestRunner : NodeBenchmarkRunner;
|
|
29
32
|
}
|
|
30
33
|
const mod = await executor.executeId(config.runner);
|
|
31
|
-
if (!mod.default && typeof mod.default !== "function")
|
|
32
|
-
throw new Error(
|
|
34
|
+
if (!mod.default && typeof mod.default !== "function") {
|
|
35
|
+
throw new Error(
|
|
36
|
+
`Runner must export a default function, but got ${typeof mod.default} imported from ${config.runner}`
|
|
37
|
+
);
|
|
38
|
+
}
|
|
33
39
|
return mod.default;
|
|
34
40
|
}
|
|
35
41
|
async function resolveTestRunner(config, executor) {
|
|
@@ -40,10 +46,12 @@ async function resolveTestRunner(config, executor) {
|
|
|
40
46
|
enumerable: false,
|
|
41
47
|
configurable: false
|
|
42
48
|
});
|
|
43
|
-
if (!testRunner.config)
|
|
49
|
+
if (!testRunner.config) {
|
|
44
50
|
testRunner.config = config;
|
|
45
|
-
|
|
51
|
+
}
|
|
52
|
+
if (!testRunner.importFile) {
|
|
46
53
|
throw new Error('Runner must implement "importFile" method.');
|
|
54
|
+
}
|
|
47
55
|
const [diffOptions] = await Promise.all([
|
|
48
56
|
loadDiffConfig(config, executor),
|
|
49
57
|
loadSnapshotSerializers(config, executor)
|