Download react-hook-form/src/__tests__/logic/getValueAndMessage.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 537 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/__tests__/logic/getValueAndMessage.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/__tests__/logic/getValueAndMessage.test.ts
-
curl -L -o getValueAndMessage.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/__tests__/logic/getValueAndMessage.test.ts
537 Bytes
| import getValueAndMessage from '../../logic/getValueAndMessage'; | |
| describe('getValueAndMessage', () => { | |
| it('should return message and value correctly', () => { | |
| expect(getValueAndMessage(0).value).toEqual(0); | |
| expect(getValueAndMessage(3).value).toEqual(3); | |
| expect(getValueAndMessage({ value: 0, message: 'what' }).value).toEqual(0); | |
| expect(getValueAndMessage({ value: 2, message: 'what' }).value).toEqual(2); | |
| expect(getValueAndMessage({ value: 1, message: 'test' }).message).toEqual( | |
| 'test', | |
| ); | |
| }); | |
| }); | |