@flemist/test-variants 0.0.10 → 0.0.13
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
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
!function(e){"use strict"
|
|
2
2
|
;e.createTestVariants=function(e){
|
|
3
|
-
return function(
|
|
4
|
-
var o=void 0===
|
|
5
|
-
;function h(e){var
|
|
6
|
-
;return"function"==typeof
|
|
3
|
+
return function(n){return function(t){
|
|
4
|
+
var o=void 0===t?{}:t,r=o.pauseInterval,u=void 0===r?1e3:r,a=o.pauseTime,i=void 0===a?10:a,f=o.logInterval,c=void 0===f?1e4:f,v=o.logCompleted,l=void 0===v||v,s=Object.keys(n),p=Object.values(n),y=s.length,g={}
|
|
5
|
+
;function h(e){var n=p[e]
|
|
6
|
+
;return"function"==typeof n&&(n=n(g)),n}
|
|
7
7
|
for(var b=[],d=[],m=0;m<y;m++)b[m]=-1,d[m]=[]
|
|
8
|
-
;function w(){for(var e=y-1;e>=0;e--){var
|
|
9
|
-
;if(
|
|
10
|
-
for(b[e]=
|
|
11
|
-
;if(0===
|
|
8
|
+
;function w(){for(var e=y-1;e>=0;e--){var n=b[e]+1
|
|
9
|
+
;if(n<d[e].length){
|
|
10
|
+
for(b[e]=n,g[s[e]]=d[e][n],e++;e<y;e++){var t=h(e)
|
|
11
|
+
;if(0===t.length)break;b[e]=0,d[e]=t,g[s[e]]=t[0]}
|
|
12
12
|
if(e>=y)return!0}}return!1}d[0]=h(0)
|
|
13
13
|
;var D=0,j=!1,O=0;function T(e){
|
|
14
|
-
console.error(JSON.stringify(g,null,2))
|
|
15
|
-
;var
|
|
16
|
-
;throw Date.now()-
|
|
17
|
-
j=!0,P(0),O++),e}var I=Date.now();function P(
|
|
18
|
-
var
|
|
19
|
-
;
|
|
20
|
-
;for(var o=u&&
|
|
21
|
-
;if("object"==typeof
|
|
22
|
-
value:
|
|
14
|
+
console.error(JSON.stringify(g,null,2)),console.error(e)
|
|
15
|
+
;var n=Date.now()
|
|
16
|
+
;throw Date.now()-n>50&&O<5&&(console.log("DEBUG ITERATION: "+O),
|
|
17
|
+
j=!0,P(0),O++),e}var I=Date.now();function P(n){
|
|
18
|
+
var t=(c||u)&&Date.now()
|
|
19
|
+
;t&&t-I>=c&&(console.log(D),I=t),D+="number"==typeof n?n:1
|
|
20
|
+
;for(var o=u&&t,r=function(){try{var n=e(g)
|
|
21
|
+
;if("object"==typeof n&&n&&"function"==typeof n.then)return{
|
|
22
|
+
value:n.catch(T).then(P)}
|
|
23
23
|
;if(o&&Date.now()-o>=u)return{
|
|
24
24
|
value:(i?new Promise((function(e){
|
|
25
|
-
setTimeout((function(){e(
|
|
26
|
-
})):Promise.resolve(
|
|
27
|
-
;D+="number"==typeof
|
|
25
|
+
setTimeout((function(){e(n)}),i)
|
|
26
|
+
})):Promise.resolve(n)).then(P)}
|
|
27
|
+
;D+="number"==typeof n?n:1}catch(e){T(e)}
|
|
28
28
|
};j||w();){var a=r()
|
|
29
29
|
;if("object"==typeof a)return a.value}
|
|
30
30
|
return l&&console.log("variants: "+D),D}
|
|
@@ -51,7 +51,7 @@ function createTestVariants(test) {
|
|
|
51
51
|
let debugIteration = 0;
|
|
52
52
|
function onError(err) {
|
|
53
53
|
console.error(JSON.stringify(variantArgs, null, 2));
|
|
54
|
-
|
|
54
|
+
console.error(err);
|
|
55
55
|
// rerun failed variant 5 times for debug
|
|
56
56
|
const time0 = Date.now();
|
|
57
57
|
// eslint-disable-next-line no-debugger
|
|
@@ -47,7 +47,7 @@ function createTestVariants(test) {
|
|
|
47
47
|
let debugIteration = 0;
|
|
48
48
|
function onError(err) {
|
|
49
49
|
console.error(JSON.stringify(variantArgs, null, 2));
|
|
50
|
-
|
|
50
|
+
console.error(err);
|
|
51
51
|
// rerun failed variant 5 times for debug
|
|
52
52
|
const time0 = Date.now();
|
|
53
53
|
// eslint-disable-next-line no-debugger
|
package/package.json
CHANGED