fix(striker-ui): allow specify options in create input test function

main
Tsu-ba-me 2 years ago
parent 94f6a2d481
commit b20d04215f
  1. 21
      striker-ui/lib/test_input/createTestInputFunction.ts

@ -2,13 +2,26 @@ import testInput from './testInput';
import {
InputTestBatches,
TestInputFunction,
TestInputFunctionOptions,
} from '../../types/TestInputFunction';
const createTestInputFunction =
(tests: InputTestBatches) =>
(
...[options, ...restArgs]: Parameters<TestInputFunction>
): ReturnType<TestInputFunction> =>
testInput({ tests, ...options }, ...restArgs);
tests: InputTestBatches,
{
excludeTestIds: defaultExcludeTestIds = [],
...restDefaultOptions
}: Omit<TestInputFunctionOptions, 'inputs' | 'tests'> = {},
) =>
({
excludeTestIds = [],
...restOptions
}: Parameters<TestInputFunction>[0] = {}): ReturnType<TestInputFunction> =>
testInput({
tests,
excludeTestIds: [...defaultExcludeTestIds, ...excludeTestIds],
...restDefaultOptions,
...restOptions,
});
export default createTestInputFunction;

Loading…
Cancel
Save