Skip to content

Commit e8524e8

Browse files
Update example-formik.md (#692)
onSubmit has two arguments and we need to ignore the second one. (https://formik.org/docs/api/formik#onsubmit-values-values-formikbag-formikbag--void--promiseany) If we do not do this then we will get an error: ``` expect(jest.fn()).toHaveBeenCalledWith(...expected) - Expected + Received {"email": "[email protected]", "password": "password2398"}, + {"resetForm": [Function anonymous], "setErrors": [Function anonymous], "setFieldError": [Function anonymous], "setFieldTouched": [Function anonymous], "setFieldValue": [Function anonymous], "setFormikState": [Function anonymous], "setStatus": [Function anonymous], "setSubmitting": [Function anonymous], "setTouched": [Function anonymous], "setValues": [Function anonymous], "submitForm": [Function anonymous], "validateField": [Function anonymous], "validateForm": [Function anonymous]}, ```
1 parent 99ef60b commit e8524e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/example-formik.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ test('rendering and submiting a basic Formik form', async () => {
7575
7676
firstName: 'Jhon',
7777
lastName: 'Dee',
78-
})
78+
}, expect.anything())
7979
)
8080
})
8181
```

0 commit comments

Comments
 (0)