File size: 732 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import isObject from '../../utils/isObject';
describe('isObject', () => {
it('should return true when value is an object', () => {
expect(isObject({})).toBeTruthy();
expect(isObject({ foo: 'bar' })).toBeTruthy();
expect(isObject(new Blob())).toBeTruthy();
});
it('should return false when value is not an object or is null', () => {
expect(isObject(null)).toBeFalsy();
expect(isObject(undefined)).toBeFalsy();
expect(isObject(-1)).toBeFalsy();
expect(isObject(0)).toBeFalsy();
expect(isObject(1)).toBeFalsy();
expect(isObject('')).toBeFalsy();
expect(isObject([])).toBeFalsy();
expect(isObject(['foo', 'bar'])).toBeFalsy();
expect(isObject(() => null)).toBeFalsy();
});
});
|