import { t, typeAsserts } from '../../index'; describe('boolean', () => { it('null', () => { expect.hasAssertions(); const schema = t.boolean(); expect(schema.validate(true)).toBe(true); expect(() => { typeAsserts(schema, true); }).not.toThrow(); expect(schema.validate(false)).toBe(true); expect(() => { typeAsserts(schema, false); }).not.toThrow(); }); it('boolean optional', () => { expect.hasAssertions(); const schema = t.boolean().optional(); expect(schema.validate(undefined)).toBe(true); expect(() => { typeAsserts(schema, undefined); }).not.toThrow(); }); });