Download react-hook-form/src/__tests__/utils/isBoolean.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/__tests__/utils/isBoolean.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/__tests__/utils/isBoolean.test.ts
-
curl -L -o isBoolean.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/__tests__/utils/isBoolean.test.ts
669 Bytes
| import isBoolean from '../../utils/isBoolean'; | |
| describe('isBoolean', () => { | |
| it('should return true when value is a boolean', () => { | |
| expect(isBoolean(true)).toBeTruthy(); | |
| expect(isBoolean(false)).toBeTruthy(); | |
| }); | |
| it('should return false when value is not a boolean', () => { | |
| expect(isBoolean(null)).toBeFalsy(); | |
| expect(isBoolean(undefined)).toBeFalsy(); | |
| expect(isBoolean(-1)).toBeFalsy(); | |
| expect(isBoolean(0)).toBeFalsy(); | |
| expect(isBoolean(1)).toBeFalsy(); | |
| expect(isBoolean('')).toBeFalsy(); | |
| expect(isBoolean({})).toBeFalsy(); | |
| expect(isBoolean([])).toBeFalsy(); | |
| expect(isBoolean(() => null)).toBeFalsy(); | |
| }); | |
| }); | |