Answer the question
In order to leave comments, you need to log in
How to test with JEST functions in react that don't return anything?
Good afternoon! I have a function in which other functions are called, tell me how can I test calling these functions?
Simplified example:
const onSend = (type) => {
const docs = getDocs(type);
const sortedDocs = sortDocs(docs);
const options = getOptions(type, docs);
if (sortedDocs) {
send(sorted, options);
} else {
sendToServer();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question