@flemist/test-variants 1.0.7 → 2.0.0-alpha
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 +270 -228
- package/dist/lib/index.cjs +6 -2
- package/dist/lib/index.d.ts +5 -2
- package/dist/lib/index.mjs +6 -2
- package/dist/lib/test-variants/argsToString.cjs +17 -0
- package/dist/lib/test-variants/argsToString.d.ts +2 -0
- package/dist/lib/test-variants/argsToString.mjs +13 -0
- package/dist/lib/test-variants/createTestVariants.cjs +68 -188
- package/dist/lib/test-variants/createTestVariants.d.ts +8 -30
- package/dist/lib/test-variants/createTestVariants.mjs +68 -188
- package/dist/lib/test-variants/createTestVariants.perf.cjs +29 -20
- package/dist/lib/test-variants/createTestVariants.perf.mjs +29 -20
- package/dist/lib/test-variants/prime.cjs +65 -0
- package/dist/lib/test-variants/prime.d.ts +3 -0
- package/dist/lib/test-variants/prime.mjs +59 -0
- package/dist/lib/test-variants/prime.perf.cjs +30 -0
- package/dist/lib/test-variants/prime.perf.d.ts +1 -0
- package/dist/lib/test-variants/prime.perf.mjs +28 -0
- package/dist/lib/test-variants/testVariantsCreateTestRun.cjs +80 -0
- package/dist/lib/test-variants/testVariantsCreateTestRun.d.ts +22 -0
- package/dist/lib/test-variants/testVariantsCreateTestRun.mjs +76 -0
- package/dist/lib/test-variants/testVariantsIterable.cjs +67 -0
- package/dist/lib/test-variants/testVariantsIterable.d.ts +12 -0
- package/dist/lib/test-variants/testVariantsIterable.mjs +63 -0
- package/dist/lib/test-variants/testVariantsRun.cjs +187 -0
- package/dist/lib/test-variants/testVariantsRun.d.ts +31 -0
- package/dist/lib/test-variants/testVariantsRun.mjs +183 -0
- package/dist/lib/test-variants/types.cjs +2 -0
- package/dist/lib/test-variants/types.d.ts +1 -0
- package/dist/lib/test-variants/types.mjs +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var abortControllerFast = require('@flemist/abort-controller-fast');
|
|
7
|
+
var asyncUtils = require('@flemist/async-utils');
|
|
8
|
+
var timeLimits = require('@flemist/time-limits');
|
|
9
|
+
var garbageCollect_garbageCollect = require('../garbage-collect/garbageCollect.cjs');
|
|
10
|
+
|
|
11
|
+
function testVariantsRun(testRun, variants, options = {}) {
|
|
12
|
+
var _a, _b, _c, _d, _e, _f;
|
|
13
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
const GC_Iterations = (_a = options.GC_Iterations) !== null && _a !== void 0 ? _a : 1000000;
|
|
15
|
+
const GC_IterationsAsync = (_b = options.GC_IterationsAsync) !== null && _b !== void 0 ? _b : 10000;
|
|
16
|
+
const GC_Interval = (_c = options.GC_Interval) !== null && _c !== void 0 ? _c : 1000;
|
|
17
|
+
const logInterval = (_d = options.logInterval) !== null && _d !== void 0 ? _d : 5000;
|
|
18
|
+
const logCompleted = (_e = options.logCompleted) !== null && _e !== void 0 ? _e : true;
|
|
19
|
+
const abortSignalExternal = options.abortSignal;
|
|
20
|
+
const findBestError = options.findBestError;
|
|
21
|
+
const parallel = options.parallel === true
|
|
22
|
+
? Math.pow(2, 31)
|
|
23
|
+
: !options.parallel || options.parallel <= 0
|
|
24
|
+
? 1
|
|
25
|
+
: options.parallel;
|
|
26
|
+
const seedsIterator = (_f = findBestError === null || findBestError === void 0 ? void 0 : findBestError.seeds[Symbol.iterator]()) !== null && _f !== void 0 ? _f : null;
|
|
27
|
+
let seedResult = seedsIterator === null || seedsIterator === void 0 ? void 0 : seedsIterator.next();
|
|
28
|
+
let bestError = null;
|
|
29
|
+
let index = -1;
|
|
30
|
+
let args = {};
|
|
31
|
+
let variantsIterator = variants[Symbol.iterator]();
|
|
32
|
+
function nextVariant() {
|
|
33
|
+
while (true) {
|
|
34
|
+
index++;
|
|
35
|
+
if (seedResult && seedResult.done) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (bestError == null || index < bestError.index) {
|
|
39
|
+
const result = variantsIterator.next();
|
|
40
|
+
if (!result.done) {
|
|
41
|
+
args = result.value;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (!seedsIterator) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
seedResult = seedsIterator.next();
|
|
49
|
+
if (seedResult.done) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
index = -1;
|
|
53
|
+
variantsIterator = variants[Symbol.iterator]();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const abortControllerParallel = new abortControllerFast.AbortControllerFast();
|
|
57
|
+
const abortSignalParallel = asyncUtils.combineAbortSignals(abortSignalExternal, abortControllerParallel.signal);
|
|
58
|
+
const abortSignalAll = abortSignalParallel;
|
|
59
|
+
let debug = false;
|
|
60
|
+
let iterations = 0;
|
|
61
|
+
let iterationsAsync = 0;
|
|
62
|
+
let prevLogTime = Date.now();
|
|
63
|
+
let prevGC_Time = prevLogTime;
|
|
64
|
+
let prevGC_Iterations = iterations;
|
|
65
|
+
let prevGC_IterationsAsync = iterationsAsync;
|
|
66
|
+
const pool = parallel <= 1
|
|
67
|
+
? null
|
|
68
|
+
: new timeLimits.Pool(parallel);
|
|
69
|
+
function onCompleted() {
|
|
70
|
+
if (logCompleted) {
|
|
71
|
+
console.log(`[test-variants] variants: ${index}, iterations: ${iterations}, async: ${iterationsAsync}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function next() {
|
|
75
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
while (!(abortSignalExternal === null || abortSignalExternal === void 0 ? void 0 : abortSignalExternal.aborted) && (debug || nextVariant())) {
|
|
77
|
+
const _index = index;
|
|
78
|
+
const _args = Object.assign(Object.assign({}, args), { seed: seedResult === null || seedResult === void 0 ? void 0 : seedResult.value });
|
|
79
|
+
const now = (logInterval || GC_Interval) && Date.now();
|
|
80
|
+
if (logInterval && now - prevLogTime >= logInterval) {
|
|
81
|
+
// the log is required to prevent the karma browserNoActivityTimeout
|
|
82
|
+
console.log(iterations);
|
|
83
|
+
prevLogTime = now;
|
|
84
|
+
}
|
|
85
|
+
if (GC_Iterations && iterations - prevGC_Iterations >= GC_Iterations
|
|
86
|
+
|| GC_IterationsAsync && iterationsAsync - prevGC_IterationsAsync >= GC_IterationsAsync
|
|
87
|
+
|| GC_Interval && now - prevGC_Time >= GC_Interval) {
|
|
88
|
+
prevGC_Iterations = iterations;
|
|
89
|
+
prevGC_IterationsAsync = iterationsAsync;
|
|
90
|
+
prevGC_Time = now;
|
|
91
|
+
yield garbageCollect_garbageCollect.garbageCollect(1);
|
|
92
|
+
}
|
|
93
|
+
if (abortSignalExternal === null || abortSignalExternal === void 0 ? void 0 : abortSignalExternal.aborted) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (!pool || abortSignalParallel.aborted) {
|
|
97
|
+
try {
|
|
98
|
+
let promiseOrIterations = testRun(_args, _index, abortSignalParallel);
|
|
99
|
+
if (asyncUtils.isPromiseLike(promiseOrIterations)) {
|
|
100
|
+
promiseOrIterations = yield promiseOrIterations;
|
|
101
|
+
}
|
|
102
|
+
if (!promiseOrIterations) {
|
|
103
|
+
debug = true;
|
|
104
|
+
abortControllerParallel.abort();
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const { iterationsAsync: _iterationsAsync, iterationsSync: _iterationsSync } = promiseOrIterations;
|
|
108
|
+
iterationsAsync += _iterationsAsync;
|
|
109
|
+
iterations += _iterationsSync + _iterationsAsync;
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
if (findBestError) {
|
|
113
|
+
bestError = {
|
|
114
|
+
error: err,
|
|
115
|
+
args: _args,
|
|
116
|
+
index: _index,
|
|
117
|
+
};
|
|
118
|
+
debug = false;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
throw err;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
if (!pool.hold(1)) {
|
|
127
|
+
yield pool.holdWait(1);
|
|
128
|
+
}
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
|
130
|
+
void (() => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
try {
|
|
132
|
+
if (abortSignalParallel === null || abortSignalParallel === void 0 ? void 0 : abortSignalParallel.aborted) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
let promiseOrIterations = testRun(_args, _index, abortSignalParallel);
|
|
136
|
+
if (asyncUtils.isPromiseLike(promiseOrIterations)) {
|
|
137
|
+
promiseOrIterations = yield promiseOrIterations;
|
|
138
|
+
}
|
|
139
|
+
if (!promiseOrIterations) {
|
|
140
|
+
debug = true;
|
|
141
|
+
abortControllerParallel.abort();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const { iterationsAsync: _iterationsAsync, iterationsSync: _iterationsSync } = promiseOrIterations;
|
|
145
|
+
iterationsAsync += _iterationsAsync;
|
|
146
|
+
iterations += _iterationsSync + _iterationsAsync;
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
if (findBestError) {
|
|
150
|
+
bestError = {
|
|
151
|
+
error: err,
|
|
152
|
+
args: _args,
|
|
153
|
+
index: _index,
|
|
154
|
+
};
|
|
155
|
+
debug = false;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
throw err;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
finally {
|
|
162
|
+
void pool.release(1);
|
|
163
|
+
}
|
|
164
|
+
}))();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (pool) {
|
|
168
|
+
yield pool.holdWait(parallel);
|
|
169
|
+
void pool.release(parallel);
|
|
170
|
+
}
|
|
171
|
+
if (abortSignalAll === null || abortSignalAll === void 0 ? void 0 : abortSignalAll.aborted) {
|
|
172
|
+
throw abortSignalAll.reason;
|
|
173
|
+
}
|
|
174
|
+
onCompleted();
|
|
175
|
+
yield garbageCollect_garbageCollect.garbageCollect(1);
|
|
176
|
+
return iterations;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
const result = yield next();
|
|
180
|
+
return {
|
|
181
|
+
iterations: result,
|
|
182
|
+
bestError,
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
exports.testVariantsRun = testVariantsRun;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TestVariantsTestRun } from './testVariantsCreateTestRun';
|
|
2
|
+
import { type IAbortSignalFast } from '@flemist/abort-controller-fast';
|
|
3
|
+
import { Obj } from "./types";
|
|
4
|
+
export declare type TestVariantsFindBestErrorOptions = {
|
|
5
|
+
seeds: Iterable<any>;
|
|
6
|
+
};
|
|
7
|
+
export declare type TestVariantsRunOptions = {
|
|
8
|
+
/** Wait for garbage collection after iterations */
|
|
9
|
+
GC_Iterations?: null | number;
|
|
10
|
+
/** Same as GC_Iterations but only for async test variants, required for 10000 and more of Promise rejections */
|
|
11
|
+
GC_IterationsAsync?: null | number;
|
|
12
|
+
/** Wait for garbage collection after time interval, required to prevent the karma browserDisconnectTimeout */
|
|
13
|
+
GC_Interval?: null | number;
|
|
14
|
+
/** console log current iterations, required to prevent the karma browserNoActivityTimeout */
|
|
15
|
+
logInterval?: null | number;
|
|
16
|
+
/** console log iterations on test completed */
|
|
17
|
+
logCompleted?: null | boolean;
|
|
18
|
+
abortSignal?: null | IAbortSignalFast;
|
|
19
|
+
parallel?: null | number | boolean;
|
|
20
|
+
findBestError?: null | TestVariantsFindBestErrorOptions;
|
|
21
|
+
};
|
|
22
|
+
export declare type TestVariantsBestError<Args extends Obj> = {
|
|
23
|
+
error: any;
|
|
24
|
+
args: Args;
|
|
25
|
+
index: number;
|
|
26
|
+
};
|
|
27
|
+
export declare type TestVariantsRunResult<Arg extends Obj> = {
|
|
28
|
+
iterations: number;
|
|
29
|
+
bestError: null | TestVariantsBestError<Arg>;
|
|
30
|
+
};
|
|
31
|
+
export declare function testVariantsRun<Args extends Obj>(testRun: TestVariantsTestRun<Args>, variants: Iterable<Args>, options?: TestVariantsRunOptions): Promise<TestVariantsRunResult<Args>>;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import { AbortControllerFast } from '@flemist/abort-controller-fast';
|
|
3
|
+
import { combineAbortSignals, isPromiseLike } from '@flemist/async-utils';
|
|
4
|
+
import { Pool } from '@flemist/time-limits';
|
|
5
|
+
import { garbageCollect } from '../garbage-collect/garbageCollect.mjs';
|
|
6
|
+
|
|
7
|
+
function testVariantsRun(testRun, variants, options = {}) {
|
|
8
|
+
var _a, _b, _c, _d, _e, _f;
|
|
9
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
const GC_Iterations = (_a = options.GC_Iterations) !== null && _a !== void 0 ? _a : 1000000;
|
|
11
|
+
const GC_IterationsAsync = (_b = options.GC_IterationsAsync) !== null && _b !== void 0 ? _b : 10000;
|
|
12
|
+
const GC_Interval = (_c = options.GC_Interval) !== null && _c !== void 0 ? _c : 1000;
|
|
13
|
+
const logInterval = (_d = options.logInterval) !== null && _d !== void 0 ? _d : 5000;
|
|
14
|
+
const logCompleted = (_e = options.logCompleted) !== null && _e !== void 0 ? _e : true;
|
|
15
|
+
const abortSignalExternal = options.abortSignal;
|
|
16
|
+
const findBestError = options.findBestError;
|
|
17
|
+
const parallel = options.parallel === true
|
|
18
|
+
? Math.pow(2, 31)
|
|
19
|
+
: !options.parallel || options.parallel <= 0
|
|
20
|
+
? 1
|
|
21
|
+
: options.parallel;
|
|
22
|
+
const seedsIterator = (_f = findBestError === null || findBestError === void 0 ? void 0 : findBestError.seeds[Symbol.iterator]()) !== null && _f !== void 0 ? _f : null;
|
|
23
|
+
let seedResult = seedsIterator === null || seedsIterator === void 0 ? void 0 : seedsIterator.next();
|
|
24
|
+
let bestError = null;
|
|
25
|
+
let index = -1;
|
|
26
|
+
let args = {};
|
|
27
|
+
let variantsIterator = variants[Symbol.iterator]();
|
|
28
|
+
function nextVariant() {
|
|
29
|
+
while (true) {
|
|
30
|
+
index++;
|
|
31
|
+
if (seedResult && seedResult.done) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
if (bestError == null || index < bestError.index) {
|
|
35
|
+
const result = variantsIterator.next();
|
|
36
|
+
if (!result.done) {
|
|
37
|
+
args = result.value;
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (!seedsIterator) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
seedResult = seedsIterator.next();
|
|
45
|
+
if (seedResult.done) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
index = -1;
|
|
49
|
+
variantsIterator = variants[Symbol.iterator]();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const abortControllerParallel = new AbortControllerFast();
|
|
53
|
+
const abortSignalParallel = combineAbortSignals(abortSignalExternal, abortControllerParallel.signal);
|
|
54
|
+
const abortSignalAll = abortSignalParallel;
|
|
55
|
+
let debug = false;
|
|
56
|
+
let iterations = 0;
|
|
57
|
+
let iterationsAsync = 0;
|
|
58
|
+
let prevLogTime = Date.now();
|
|
59
|
+
let prevGC_Time = prevLogTime;
|
|
60
|
+
let prevGC_Iterations = iterations;
|
|
61
|
+
let prevGC_IterationsAsync = iterationsAsync;
|
|
62
|
+
const pool = parallel <= 1
|
|
63
|
+
? null
|
|
64
|
+
: new Pool(parallel);
|
|
65
|
+
function onCompleted() {
|
|
66
|
+
if (logCompleted) {
|
|
67
|
+
console.log(`[test-variants] variants: ${index}, iterations: ${iterations}, async: ${iterationsAsync}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function next() {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
while (!(abortSignalExternal === null || abortSignalExternal === void 0 ? void 0 : abortSignalExternal.aborted) && (debug || nextVariant())) {
|
|
73
|
+
const _index = index;
|
|
74
|
+
const _args = Object.assign(Object.assign({}, args), { seed: seedResult === null || seedResult === void 0 ? void 0 : seedResult.value });
|
|
75
|
+
const now = (logInterval || GC_Interval) && Date.now();
|
|
76
|
+
if (logInterval && now - prevLogTime >= logInterval) {
|
|
77
|
+
// the log is required to prevent the karma browserNoActivityTimeout
|
|
78
|
+
console.log(iterations);
|
|
79
|
+
prevLogTime = now;
|
|
80
|
+
}
|
|
81
|
+
if (GC_Iterations && iterations - prevGC_Iterations >= GC_Iterations
|
|
82
|
+
|| GC_IterationsAsync && iterationsAsync - prevGC_IterationsAsync >= GC_IterationsAsync
|
|
83
|
+
|| GC_Interval && now - prevGC_Time >= GC_Interval) {
|
|
84
|
+
prevGC_Iterations = iterations;
|
|
85
|
+
prevGC_IterationsAsync = iterationsAsync;
|
|
86
|
+
prevGC_Time = now;
|
|
87
|
+
yield garbageCollect(1);
|
|
88
|
+
}
|
|
89
|
+
if (abortSignalExternal === null || abortSignalExternal === void 0 ? void 0 : abortSignalExternal.aborted) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (!pool || abortSignalParallel.aborted) {
|
|
93
|
+
try {
|
|
94
|
+
let promiseOrIterations = testRun(_args, _index, abortSignalParallel);
|
|
95
|
+
if (isPromiseLike(promiseOrIterations)) {
|
|
96
|
+
promiseOrIterations = yield promiseOrIterations;
|
|
97
|
+
}
|
|
98
|
+
if (!promiseOrIterations) {
|
|
99
|
+
debug = true;
|
|
100
|
+
abortControllerParallel.abort();
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const { iterationsAsync: _iterationsAsync, iterationsSync: _iterationsSync } = promiseOrIterations;
|
|
104
|
+
iterationsAsync += _iterationsAsync;
|
|
105
|
+
iterations += _iterationsSync + _iterationsAsync;
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
if (findBestError) {
|
|
109
|
+
bestError = {
|
|
110
|
+
error: err,
|
|
111
|
+
args: _args,
|
|
112
|
+
index: _index,
|
|
113
|
+
};
|
|
114
|
+
debug = false;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
throw err;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
if (!pool.hold(1)) {
|
|
123
|
+
yield pool.holdWait(1);
|
|
124
|
+
}
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
|
126
|
+
void (() => __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
try {
|
|
128
|
+
if (abortSignalParallel === null || abortSignalParallel === void 0 ? void 0 : abortSignalParallel.aborted) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
let promiseOrIterations = testRun(_args, _index, abortSignalParallel);
|
|
132
|
+
if (isPromiseLike(promiseOrIterations)) {
|
|
133
|
+
promiseOrIterations = yield promiseOrIterations;
|
|
134
|
+
}
|
|
135
|
+
if (!promiseOrIterations) {
|
|
136
|
+
debug = true;
|
|
137
|
+
abortControllerParallel.abort();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const { iterationsAsync: _iterationsAsync, iterationsSync: _iterationsSync } = promiseOrIterations;
|
|
141
|
+
iterationsAsync += _iterationsAsync;
|
|
142
|
+
iterations += _iterationsSync + _iterationsAsync;
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
if (findBestError) {
|
|
146
|
+
bestError = {
|
|
147
|
+
error: err,
|
|
148
|
+
args: _args,
|
|
149
|
+
index: _index,
|
|
150
|
+
};
|
|
151
|
+
debug = false;
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
throw err;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
finally {
|
|
158
|
+
void pool.release(1);
|
|
159
|
+
}
|
|
160
|
+
}))();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (pool) {
|
|
164
|
+
yield pool.holdWait(parallel);
|
|
165
|
+
void pool.release(parallel);
|
|
166
|
+
}
|
|
167
|
+
if (abortSignalAll === null || abortSignalAll === void 0 ? void 0 : abortSignalAll.aborted) {
|
|
168
|
+
throw abortSignalAll.reason;
|
|
169
|
+
}
|
|
170
|
+
onCompleted();
|
|
171
|
+
yield garbageCollect(1);
|
|
172
|
+
return iterations;
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
const result = yield next();
|
|
176
|
+
return {
|
|
177
|
+
iterations: result,
|
|
178
|
+
bestError,
|
|
179
|
+
};
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export { testVariantsRun };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type Obj = Record<string, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flemist/test-variants",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha",
|
|
4
4
|
"description": "Runs a test function with all possible combinations of its parameters.",
|
|
5
5
|
"main": "dist/lib/index.cjs",
|
|
6
6
|
"module": "dist/lib/index.mjs",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@babel/plugin-transform-classes": "7.18.4",
|
|
56
56
|
"@babel/plugin-transform-runtime": "7.18.5",
|
|
57
57
|
"@babel/preset-env": "7.18.2",
|
|
58
|
-
"@babel/runtime-corejs3": "7.
|
|
58
|
+
"@babel/runtime-corejs3": "7.28.3",
|
|
59
59
|
"@flemist/copy-glob-flat": "0.0.5",
|
|
60
60
|
"@flemist/karma-custom-launcher": "0.0.0",
|
|
61
61
|
"@flemist/test-utils": "1.0.2",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@rollup/plugin-multi-entry": "4.1.0",
|
|
68
68
|
"@rollup/plugin-node-resolve": "13.3.0",
|
|
69
69
|
"@rollup/plugin-replace": "4.0.0",
|
|
70
|
-
"@rollup/plugin-typescript": "
|
|
70
|
+
"@rollup/plugin-typescript": "12.1.4",
|
|
71
71
|
"@rollup/pluginutils": "4.2.1",
|
|
72
72
|
"@types/assert": "1.5.6",
|
|
73
73
|
"@types/mocha": "9.1.1",
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
"karma-safari-launcher": "1.0.0",
|
|
86
86
|
"mocha": "9.2.2",
|
|
87
87
|
"nyc": "15.1.0",
|
|
88
|
-
"rdtsc": "
|
|
88
|
+
"rdtsc": "5.0.7",
|
|
89
89
|
"rimraf": "3.0.2",
|
|
90
|
-
"rollup": "2.
|
|
90
|
+
"rollup": "2.79.2",
|
|
91
91
|
"rollup-plugin-delete": "2.0.0",
|
|
92
92
|
"rollup-plugin-istanbul": "3.0.0",
|
|
93
93
|
"rollup-plugin-multi-input": "1.3.1",
|
|
@@ -101,6 +101,6 @@
|
|
|
101
101
|
"@flemist/abort-controller-fast": "^1.0.0",
|
|
102
102
|
"@flemist/async-utils": "^1.0.0",
|
|
103
103
|
"@flemist/time-limits": "^1.0.1",
|
|
104
|
-
"tslib": "
|
|
104
|
+
"tslib": "2.5.3"
|
|
105
105
|
}
|
|
106
106
|
}
|