/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/__tests__/utils/isPrimitive.test.ts
35 строк
967 B
Bill
7️⃣ V7 (#3741)
01 апр 2021, 00:14
Не верифицирован
01 апр 2021, 00:14
9555d16
Код
Авторство
О чём код?
import isPrimitive from '../../utils/isPrimitive'; describe('isPrimitive', () => { it('should return true when value is a string', () => { expect(isPrimitive('foobar')).toBeTruthy(); }); it('should return true when value is a boolean', () => { expect(isPrimitive(false)).toBeTruthy(); }); it('should return true when value is a number', () => { expect(isPrimitive(123)).toBeTruthy(); }); it('should return true when value is a symbol', () => { expect(isPrimitive(Symbol())).toBeTruthy(); }); it('should return true when value is null', () => { expect(isPrimitive(null)).toBeTruthy(); }); it('should return true when value is undefined', () => { expect(isPrimitive(undefined)).toBeTruthy(); }); it('should return false when value is an object', () => { expect(isPrimitive({})).toBeFalsy(); }); it('should return false when value is an array', () => { expect(isPrimitive([])).toBeFalsy(); }); });