@flemist/test-variants 1.0.5 → 1.0.6
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/bundle/browser.js
CHANGED
|
@@ -264,19 +264,20 @@ n?(e||(e=new c,n.subscribe(r)),i.subscribe(r)):n=i
|
|
|
264
264
|
;function F(t){var e=A[t]
|
|
265
265
|
;return"function"==typeof e&&(e=e(O)),e}
|
|
266
266
|
for(var I=[],R=[],M=0;M<T;M++)I[M]=-1,R[M]=[]
|
|
267
|
-
;R[0]=F(0);var C=0,D=0,G=!1,$=0
|
|
268
|
-
|
|
267
|
+
;R[0]=F(0);var C=0,D=0,G=!1,$=0,q=!0
|
|
268
|
+
;function N(t,e,s){
|
|
269
|
+
return n(this,void 0,void 0,(function(){var n,i
|
|
269
270
|
;return r(this,(function(r){switch(r.label){
|
|
270
271
|
case 0:
|
|
271
|
-
return P.abort(t),console.error("error variant: ".concat(e,"\r\n").concat(JSON.stringify(s,(function(t,e){
|
|
272
|
+
return n=q,q=!1,n&&(P.abort(t),console.error("error variant: ".concat(e,"\r\n").concat(JSON.stringify(s,(function(t,e){
|
|
272
273
|
return e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor!==Object?e+"":e
|
|
273
274
|
}),2))),
|
|
274
|
-
console.error(t),
|
|
275
|
-
G=!0,[4,
|
|
276
|
-
;case 2:throw g&&g({iteration:e,variant:s,
|
|
277
|
-
}),t}}))}))}
|
|
278
|
-
var
|
|
279
|
-
;function
|
|
275
|
+
console.error(t)),i=Date.now(),Date.now()-i>50&&$<5?(console.log("DEBUG ITERATION: "+$),
|
|
276
|
+
G=!0,[4,H()]):[3,2];case 1:r.sent(),$++,r.label=2
|
|
277
|
+
;case 2:if(n)throw g&&g({iteration:e,variant:s,
|
|
278
|
+
error:t}),t;return[2]}}))}))}
|
|
279
|
+
var U=Date.now(),W=U,Q=C,B=D,J=!0===x?Math.pow(2,31):!x||x<=0?1:x,K=J<=1?null:new E(J)
|
|
280
|
+
;function V(e,s,i){
|
|
280
281
|
return n(this,void 0,void 0,(function(){var n,o,l
|
|
281
282
|
;return r(this,(function(r){switch(r.label){
|
|
282
283
|
case 0:return r.trys.push([0,3,,5]),function(t){
|
|
@@ -284,27 +285,27 @@ return"object"==typeof t&&t&&"function"==typeof t.then
|
|
|
284
285
|
}(n=t(s,i))?[4,n]:[3,2];case 1:
|
|
285
286
|
return o=r.sent(),D+=l="number"==typeof o?o:1,C+=l,
|
|
286
287
|
[2];case 2:return C+="number"==typeof n?n:1,[3,5]
|
|
287
|
-
;case 3:return[4,
|
|
288
|
+
;case 3:return[4,N(r.sent(),e,s)];case 4:
|
|
288
289
|
return r.sent(),[3,5];case 5:return[2]}}))}))}
|
|
289
|
-
function
|
|
290
|
+
function H(){
|
|
290
291
|
return n(this,void 0,void 0,(function(){
|
|
291
292
|
var t,i=this;return r(this,(function(o){
|
|
292
293
|
switch(o.label){case 0:t=function(){var t,o,l
|
|
293
294
|
;return r(this,(function(c){switch(c.label){
|
|
294
295
|
case 0:
|
|
295
|
-
return t=C,o=
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
return t=C,o=K?e({},O):O,l=(b||_)&&Date.now(),b&&l-U>=b&&(console.log(C),
|
|
297
|
+
U=l),a&&C-Q>=a||f&&D-B>=f||_&&l-W>=_?(Q=C,
|
|
298
|
+
B=D,W=l,[4,s(1)]):[3,2];case 1:
|
|
298
299
|
return c.sent(),[2,"continue"];case 2:
|
|
299
|
-
return(null==j?void 0:j.aborted)?[2,"continue"]:
|
|
300
|
+
return(null==j?void 0:j.aborted)?[2,"continue"]:K&&!S.aborted?[3,4]:[4,V(t,o,j)]
|
|
300
301
|
;case 3:return c.sent(),[3,7];case 4:
|
|
301
|
-
return
|
|
302
|
+
return K.hold(1)?[3,6]:[4,K.holdWait(1)];case 5:
|
|
302
303
|
c.sent(),c.label=6;case 6:
|
|
303
304
|
n(i,void 0,void 0,(function(){
|
|
304
305
|
return r(this,(function(e){switch(e.label){case 0:
|
|
305
|
-
return e.trys.push([0,,2,3]),(null==S?void 0:S.aborted)?[2]:[4,
|
|
306
|
+
return e.trys.push([0,,2,3]),(null==S?void 0:S.aborted)?[2]:[4,V(t,o,S)]
|
|
306
307
|
;case 1:return e.sent(),[3,3];case 2:
|
|
307
|
-
return
|
|
308
|
+
return K.release(1),[7];case 3:return[2]}}))
|
|
308
309
|
})),c.label=7;case 7:return[2]}}))},o.label=1
|
|
309
310
|
;case 1:
|
|
310
311
|
return(null==j?void 0:j.aborted)||!G&&!function(){
|
|
@@ -314,10 +315,10 @@ for(I[t]=e,O[z[t]]=R[t][e],t++;t<T;t++){var n=F(t)
|
|
|
314
315
|
;if(0===n.length)break;I[t]=0,R[t]=n,O[z[t]]=n[0]}
|
|
315
316
|
if(t>=T)return!0}}return!1}()?[3,3]:[5,t()]
|
|
316
317
|
;case 2:return o.sent(),[3,1];case 3:
|
|
317
|
-
return
|
|
318
|
-
o.sent(),
|
|
318
|
+
return K?[4,K.holdWait(J)]:[3,5];case 4:
|
|
319
|
+
o.sent(),K.release(J),o.label=5;case 5:
|
|
319
320
|
if(null==k?void 0:k.aborted)throw k.reason
|
|
320
321
|
;return y&&console.log("variants: "+C),[4,s(1)]
|
|
321
|
-
;case 6:return o.sent(),[2,C]}}))}))}return
|
|
322
|
+
;case 6:return o.sent(),[2,C]}}))}))}return H()}}
|
|
322
323
|
},Object.defineProperty(t,"__esModule",{value:!0})
|
|
323
324
|
}({});
|
|
@@ -64,19 +64,24 @@ function createTestVariants(test) {
|
|
|
64
64
|
let iterationsAsync = 0;
|
|
65
65
|
let debug = false;
|
|
66
66
|
let debugIteration = 0;
|
|
67
|
+
let isNewError = true;
|
|
67
68
|
function onError(error, iterations, variantArgs) {
|
|
68
69
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
const _isNewError = isNewError;
|
|
71
|
+
isNewError = false;
|
|
72
|
+
if (_isNewError) {
|
|
73
|
+
abortControllerParallel.abort(error);
|
|
74
|
+
console.error(`error variant: ${iterations}\r\n${JSON.stringify(variantArgs, (_, value) => {
|
|
75
|
+
if (value
|
|
76
|
+
&& typeof value === 'object'
|
|
77
|
+
&& !Array.isArray(value)
|
|
78
|
+
&& value.constructor !== Object) {
|
|
79
|
+
return value + '';
|
|
80
|
+
}
|
|
81
|
+
return value;
|
|
82
|
+
}, 2)}`);
|
|
83
|
+
console.error(error);
|
|
84
|
+
}
|
|
80
85
|
// rerun failed variant 5 times for debug
|
|
81
86
|
const time0 = Date.now();
|
|
82
87
|
// eslint-disable-next-line no-debugger
|
|
@@ -87,14 +92,16 @@ function createTestVariants(test) {
|
|
|
87
92
|
yield next();
|
|
88
93
|
debugIteration++;
|
|
89
94
|
}
|
|
90
|
-
if (
|
|
91
|
-
onErrorCallback
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
if (_isNewError) {
|
|
96
|
+
if (onErrorCallback) {
|
|
97
|
+
onErrorCallback({
|
|
98
|
+
iteration: iterations,
|
|
99
|
+
variant: variantArgs,
|
|
100
|
+
error,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
throw error;
|
|
96
104
|
}
|
|
97
|
-
throw error;
|
|
98
105
|
});
|
|
99
106
|
}
|
|
100
107
|
function onCompleted() {
|
|
@@ -60,19 +60,24 @@ function createTestVariants(test) {
|
|
|
60
60
|
let iterationsAsync = 0;
|
|
61
61
|
let debug = false;
|
|
62
62
|
let debugIteration = 0;
|
|
63
|
+
let isNewError = true;
|
|
63
64
|
function onError(error, iterations, variantArgs) {
|
|
64
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
const _isNewError = isNewError;
|
|
67
|
+
isNewError = false;
|
|
68
|
+
if (_isNewError) {
|
|
69
|
+
abortControllerParallel.abort(error);
|
|
70
|
+
console.error(`error variant: ${iterations}\r\n${JSON.stringify(variantArgs, (_, value) => {
|
|
71
|
+
if (value
|
|
72
|
+
&& typeof value === 'object'
|
|
73
|
+
&& !Array.isArray(value)
|
|
74
|
+
&& value.constructor !== Object) {
|
|
75
|
+
return value + '';
|
|
76
|
+
}
|
|
77
|
+
return value;
|
|
78
|
+
}, 2)}`);
|
|
79
|
+
console.error(error);
|
|
80
|
+
}
|
|
76
81
|
// rerun failed variant 5 times for debug
|
|
77
82
|
const time0 = Date.now();
|
|
78
83
|
// eslint-disable-next-line no-debugger
|
|
@@ -83,14 +88,16 @@ function createTestVariants(test) {
|
|
|
83
88
|
yield next();
|
|
84
89
|
debugIteration++;
|
|
85
90
|
}
|
|
86
|
-
if (
|
|
87
|
-
onErrorCallback
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
if (_isNewError) {
|
|
92
|
+
if (onErrorCallback) {
|
|
93
|
+
onErrorCallback({
|
|
94
|
+
iteration: iterations,
|
|
95
|
+
variant: variantArgs,
|
|
96
|
+
error,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
throw error;
|
|
92
100
|
}
|
|
93
|
-
throw error;
|
|
94
101
|
});
|
|
95
102
|
}
|
|
96
103
|
function onCompleted() {
|