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