File size: 650 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import isNullOrUndefined from '../../utils/isNullOrUndefined';
describe('isNullOrUndefined', () => {
it('should return true when object is null or undefined', () => {
expect(isNullOrUndefined(null)).toBeTruthy();
expect(isNullOrUndefined(undefined)).toBeTruthy();
});
it('should return false when object is neither null nor undefined', () => {
expect(isNullOrUndefined(-1)).toBeFalsy();
expect(isNullOrUndefined(0)).toBeFalsy();
expect(isNullOrUndefined(1)).toBeFalsy();
expect(isNullOrUndefined('')).toBeFalsy();
expect(isNullOrUndefined({})).toBeFalsy();
expect(isNullOrUndefined([])).toBeFalsy();
});
});
|