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

Loading…
Cancel
Save