@flemist/test-variants 5.0.2 → 5.0.4
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/README.md +4 -0
- package/build/browser/index.cjs +1 -1
- package/build/browser/index.mjs +1 -1
- package/build/common/index.cjs +1 -1
- package/build/common/index.mjs +1 -1
- package/build/common/test-variants/iterator/helpers/compareLexicographic.d.ts +5 -0
- package/build/common/test-variants/iterator/types.d.ts +9 -2
- package/build/common/test-variants/iterator/variant-navigation/variantNavigation.d.ts +2 -0
- package/build/common/test-variants/run/types.d.ts +2 -0
- package/build/common/test-variants/types.d.ts +2 -0
- package/build/createTestVariants-D3rpiTL9.mjs +1029 -0
- package/build/createTestVariants-cAlu7ujN.js +4 -0
- package/build/node/index.cjs +1 -1
- package/build/node/index.mjs +89 -58
- package/package.json +1 -1
- package/build/createTestVariants-BE_TQ9u5.mjs +0 -1018
- package/build/createTestVariants-Cmx68kHs.js +0 -4
package/README.md
CHANGED
|
@@ -248,6 +248,10 @@ const result = await testVariants({
|
|
|
248
248
|
tests, // number of tests run before this mode change
|
|
249
249
|
}) => void | Promise<void>,
|
|
250
250
|
|
|
251
|
+
// Pause debugger on error; requires IDE "step into library" enabled
|
|
252
|
+
// Repeats failing variant up to 5 times in debug mode
|
|
253
|
+
pauseDebuggerOnError: boolean | null, // default: true
|
|
254
|
+
|
|
251
255
|
// Time controller for all internal delays, timeouts and getting current time
|
|
252
256
|
// Used inside testVariants instead of direct setTimeout, Date.now calls, etc
|
|
253
257
|
// Intended only for testing and debugging the test-variants library itself
|
package/build/browser/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../createTestVariants-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../createTestVariants-cAlu7ujN.js");exports.createTestVariants=e.createTestVariants;
|
package/build/browser/index.mjs
CHANGED
package/build/common/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../createTestVariants-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../createTestVariants-cAlu7ujN.js");exports.createTestVariants=e.createTestVariants;
|
package/build/common/index.mjs
CHANGED
|
@@ -14,10 +14,13 @@ export type AddLimitOptions<Args extends Obj> = {
|
|
|
14
14
|
error?: unknown;
|
|
15
15
|
/** Number of tests run when this limit is applied */
|
|
16
16
|
tests?: null | number;
|
|
17
|
+
};
|
|
18
|
+
/** Options for calcIndexes method */
|
|
19
|
+
export type CalcIndexesOptions = {
|
|
17
20
|
/** Limit per-arg indexes; boolean enables/disables, function for custom per-arg logic */
|
|
18
21
|
limitArg?: null | boolean | LimitArgOnError;
|
|
19
|
-
/**
|
|
20
|
-
|
|
22
|
+
/** When true, error variant is included in iteration (for debugging); default false excludes it */
|
|
23
|
+
includeLimit?: null | boolean;
|
|
21
24
|
};
|
|
22
25
|
/** Options for creating test variants iterator */
|
|
23
26
|
export type VariantsIteratorOptions<Args extends Obj> = {
|
|
@@ -70,6 +73,10 @@ export type VariantsIterator<Args extends Obj> = {
|
|
|
70
73
|
readonly tests: number;
|
|
71
74
|
/** Add or tighten limit */
|
|
72
75
|
addLimit(options?: null | AddLimitOptions<Args>): void;
|
|
76
|
+
/** Calculate indexes for args; returns null if args not in templates or beyond limit */
|
|
77
|
+
calcIndexes(args: ArgsWithSeed<Args>, options?: null | CalcIndexesOptions): number[] | null;
|
|
78
|
+
/** Extend templates with args values that are not in templates */
|
|
79
|
+
extendTemplates(args: Args): void;
|
|
73
80
|
/** Get next variant or null when done */
|
|
74
81
|
next(): ArgsWithSeed<Args> | null;
|
|
75
82
|
};
|
|
@@ -8,6 +8,8 @@ export declare function createVariantNavigationState<Args extends Obj, Extra ext
|
|
|
8
8
|
export declare function calcArgValues<Args extends Obj>(state: VariantNavigationState<Args>, argName: ArgName<Args>): readonly any[];
|
|
9
9
|
/** Get max possible arg value index, considering limits */
|
|
10
10
|
export declare function getArgValueMaxIndex(state: VariantNavigationState<any>, argIndex: number, belowMax: boolean): number;
|
|
11
|
+
/** Check if variant navigation is at limit or beyond (lexicographic comparison) */
|
|
12
|
+
export declare function isVariantNavigationAtLimit<Args extends Obj>(state: VariantNavigationState<Args>): boolean;
|
|
11
13
|
/** Reset variant navigation to initial state; variant position will be undefined */
|
|
12
14
|
export declare function resetVariantNavigation<Args extends Obj>(state: VariantNavigationState<Args>): void;
|
|
13
15
|
/** Advance to next variant in cartesian product; returns true if successful */
|
|
@@ -52,6 +52,8 @@ export type TestVariantsCreateTestRunOptions<Args extends Obj> = {
|
|
|
52
52
|
onError?: null | OnErrorCallback<Args>;
|
|
53
53
|
/** Resolved logging options */
|
|
54
54
|
log: RequiredNonNullable<TestVariantsLogOptions>;
|
|
55
|
+
/** Pause debugger on error */
|
|
56
|
+
pauseDebuggerOnError?: null | boolean;
|
|
55
57
|
};
|
|
56
58
|
export type TestVariantsCall<Args extends Obj> = <SavedArgs = Args>(options?: null | TestVariantsRunOptionsInternal<Args, SavedArgs>) => PromiseOrValue<TestVariantsResult<Args>>;
|
|
57
59
|
export type TestVariantsSetArgs<Args extends Obj> = <ArgsExtra extends Obj>(args: TestVariantsTemplatesExt<Omit<Args, 'seed'>, Omit<ArgsExtra, 'seed'>>) => TestVariantsCall<Args>;
|
|
@@ -158,6 +158,8 @@ export type TestVariantsRunOptions<Args extends Obj = Obj, SavedArgs = Args> = {
|
|
|
158
158
|
onError?: null | OnErrorCallback<Args>;
|
|
159
159
|
/** Callback invoked when iteration mode changes */
|
|
160
160
|
onModeChange?: null | OnModeChangeCallback;
|
|
161
|
+
/** Pause debugger on error */
|
|
162
|
+
pauseDebuggerOnError?: null | boolean;
|
|
161
163
|
/** Wait for garbage collection after iterations */
|
|
162
164
|
GC_Iterations?: null | number;
|
|
163
165
|
/** Same as GC_Iterations but only for async test variants, required for 10000 and more of Promise rejections */
|