Path: blob/1.0-develop/resources/scripts/lib/objects.spec.ts
7458 views
import { isObject } from '@/lib/objects';12describe('@/lib/objects.ts', function () {3describe('isObject()', function () {4it('should return true for objects', function () {5expect(isObject({})).toBe(true);6expect(isObject({ foo: 123 })).toBe(true);7expect(isObject(Object.freeze({}))).toBe(true);8});910it('should return false for null', function () {11expect(isObject(null)).toBe(false);12});1314it.each([undefined, 123, 'foobar', () => ({}), Function, String(123), isObject, () => null, [], [1, 2, 3]])(15'should return false for %p',16function (value) {17expect(isObject(value)).toBe(false);18}19);20});21});222324