Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/resources/scripts/lib/objects.spec.ts
7458 views
1
import { isObject } from '@/lib/objects';
2
3
describe('@/lib/objects.ts', function () {
4
describe('isObject()', function () {
5
it('should return true for objects', function () {
6
expect(isObject({})).toBe(true);
7
expect(isObject({ foo: 123 })).toBe(true);
8
expect(isObject(Object.freeze({}))).toBe(true);
9
});
10
11
it('should return false for null', function () {
12
expect(isObject(null)).toBe(false);
13
});
14
15
it.each([undefined, 123, 'foobar', () => ({}), Function, String(123), isObject, () => null, [], [1, 2, 3]])(
16
'should return false for %p',
17
function (value) {
18
expect(isObject(value)).toBe(false);
19
}
20
);
21
});
22
});
23
24