import { ManyTestsHelper } from './helper'; import { TestFn } from './types'; import { assertValidation } from '../assert-validation'; export class ShouldMakeTests { constructor(private readonly help: ManyTestsHelper) {} beValid: TestFn = ({ input, testKey, schema, valid }) => { test(`${testKey} - should be ${this.help.valid(valid)}`, () => { const result = schema.validate(input); assertValidation(result).toBe(valid); }); }; notThrowAnyError: TestFn = ({ schema, input, testKey }) => { test(`${testKey} - should not throw any error`, () => { expect(() => schema.validate(input)).not.toThrow(); }); }; }