|
|
@ -1,12 +1,6 @@ |
|
|
|
export type InputTestValue = |
|
|
|
type InputTestValue = bigint | boolean | number | null | string | undefined; |
|
|
|
| bigint |
|
|
|
|
|
|
|
| boolean |
|
|
|
|
|
|
|
| number |
|
|
|
|
|
|
|
| null |
|
|
|
|
|
|
|
| string |
|
|
|
|
|
|
|
| undefined; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export type InputTestArgs = { |
|
|
|
type InputTestArgs = { |
|
|
|
compare?: InputTestValue[]; |
|
|
|
compare?: InputTestValue[]; |
|
|
|
displayMax?: string; |
|
|
|
displayMax?: string; |
|
|
|
displayMin?: string; |
|
|
|
displayMin?: string; |
|
|
@ -18,7 +12,7 @@ export type InputTestArgs = { |
|
|
|
value?: InputTestValue; |
|
|
|
value?: InputTestValue; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export type MinimalInputTestArgs = Required< |
|
|
|
type MinimalInputTestArgs = Required< |
|
|
|
Omit< |
|
|
|
Omit< |
|
|
|
InputTestArgs, |
|
|
|
InputTestArgs, |
|
|
|
| 'displayMax' |
|
|
|
| 'displayMax' |
|
|
@ -29,31 +23,31 @@ export type MinimalInputTestArgs = Required< |
|
|
|
> |
|
|
|
> |
|
|
|
>; |
|
|
|
>; |
|
|
|
|
|
|
|
|
|
|
|
export type CallbackAppendArgs = { |
|
|
|
type CallbackAppendArgs = { |
|
|
|
append: { |
|
|
|
append: { |
|
|
|
[arg: string]: InputTestValue; |
|
|
|
[arg: string]: InputTestValue; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export type InputTestFailureCallback = ( |
|
|
|
type InputTestFailureCallback = ( |
|
|
|
args: InputTestArgs & CallbackAppendArgs, |
|
|
|
args: InputTestArgs & CallbackAppendArgs, |
|
|
|
) => void; |
|
|
|
) => void; |
|
|
|
|
|
|
|
|
|
|
|
export type InputTestSuccessCallback = (args: CallbackAppendArgs) => void; |
|
|
|
type InputTestSuccessCallback = (args: CallbackAppendArgs) => void; |
|
|
|
|
|
|
|
|
|
|
|
export type InputTest = { |
|
|
|
type InputTest = { |
|
|
|
onFailure?: InputTestFailureCallback; |
|
|
|
onFailure?: InputTestFailureCallback; |
|
|
|
onSuccess?: InputTestSuccessCallback; |
|
|
|
onSuccess?: InputTestSuccessCallback; |
|
|
|
test: (args: MinimalInputTestArgs & CallbackAppendArgs) => boolean; |
|
|
|
test: (args: MinimalInputTestArgs & CallbackAppendArgs) => boolean; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export type InputTestInputs = { |
|
|
|
type InputTestInputs = { |
|
|
|
[id: string]: Partial<InputTestArgs>; |
|
|
|
[id: string]: Partial<InputTestArgs>; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export type InputTestBatchFinishCallback = () => void; |
|
|
|
type InputTestBatchFinishCallback = () => void; |
|
|
|
|
|
|
|
|
|
|
|
export type InputTestBatches = { |
|
|
|
type InputTestBatches = { |
|
|
|
[id: string]: { |
|
|
|
[id: string]: { |
|
|
|
defaults?: InputTestArgs & { |
|
|
|
defaults?: InputTestArgs & { |
|
|
|
onSuccess?: InputTestSuccessCallback; |
|
|
|
onSuccess?: InputTestSuccessCallback; |
|
|
@ -64,7 +58,7 @@ export type InputTestBatches = { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export type TestInputFunctionOptions = { |
|
|
|
type TestInputFunctionOptions = { |
|
|
|
excludeTestIds?: string[]; |
|
|
|
excludeTestIds?: string[]; |
|
|
|
excludeTestIdsRe?: RegExp; |
|
|
|
excludeTestIdsRe?: RegExp; |
|
|
|
inputs?: InputTestInputs; |
|
|
|
inputs?: InputTestInputs; |
|
|
@ -74,4 +68,4 @@ export type TestInputFunctionOptions = { |
|
|
|
tests?: InputTestBatches; |
|
|
|
tests?: InputTestBatches; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export type TestInputFunction = (options?: TestInputFunctionOptions) => boolean; |
|
|
|
type TestInputFunction = (options?: TestInputFunctionOptions) => boolean; |