import { isFunction } from './index'; describe('测试 types 模块 isFunction 方法', () => { it('Number类型', () => { expect(isFunction(111)).toBe(false); }); it('String类型', () => { expect(isFunction('11111')).toBe(false); }); it('Array类型', () => { expect(isFunction(['11111', '22222'])).toBe(false); }); it('Object类型', () => { expect(isFunction({ name: 'xxx' })).toBe(false); }); it('Function类型', () => { expect(isFunction(() => {})).toBe(true); }); it('undefined', () => { expect(isFunction(undefined)).toBe(false); }); it('Null', () => { expect(isFunction(null)).toBe(false); }); });