Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function checkTypesWithVoidResult() {
act(() => {});
}
function checkTypesWithUndefinedResult() {
act(() => undefined);
}
function checkTypesWithPromiseResult() {
act(() => Promise.resolve());
}
function checkTypesWithVoidResult() {
const callback = () => {}
act(callback)
}
function checkTypesWithUndefinedResult() {
const callback = () => undefined
act(callback)
}
it('when validation and submit successful', async () => {
const { result, waitForNextUpdate } = renderHook(() =>
useForm(options)
);
const func: any = async () => {
result.current.handleSubmit(event);
await waitForNextUpdate();
};
await act(func);
expect(result.current).toMatchSnapshot();
expect(options.onSubmit).toBeCalledWith(values);
});