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