Download react-hook-form/src/__tests__/utils/compact.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 495 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/__tests__/utils/compact.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/__tests__/utils/compact.test.ts
-
curl -L -o compact.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/__tests__/utils/compact.test.ts
495 Bytes
| import filterOutFalsy from '../../utils/compact'; | |
| describe('filterOutFalsy', () => { | |
| it('should return filtered array when array value is falsy ', () => { | |
| expect(filterOutFalsy([1, 2, 3, 4])).toEqual([1, 2, 3, 4]); | |
| expect(filterOutFalsy([1, 2, false, 4])).toEqual([1, 2, 4]); | |
| expect(filterOutFalsy([1, 2, '', 4])).toEqual([1, 2, 4]); | |
| expect(filterOutFalsy([1, 2, undefined, 4])).toEqual([1, 2, 4]); | |
| expect(filterOutFalsy([0, 1, 2, 3, 4])).toEqual([1, 2, 3, 4]); | |
| }); | |
| }); | |