/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/__tests__/utils/isNullOrUndefined.test.ts
17 строк
650 B
Bill
7️⃣ V7 (#3741)
01 апр 2021, 00:14
Не верифицирован
01 апр 2021, 00:14
9555d16
Код
Авторство
О чём код?
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(); }); });