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