python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
React Jest Unit Testing await in private function uncovered line
I call a async function in useEffect
const [documents, setDocuments] = useState(Array());
async function findDocuments() {
const res = await findDocumentList([], {});
setDocuments(res.data...
MareCieco
Votes: 0
Answers: 1
How to ignore the catch clause of a promise in Jest test coverage?
In my unit tests I have one case where I get a promise from a browser API (IndexedDB) and added a catch clause to handle any error condition. For obvious reasons I cannot trigger the promise to fail i...
Mike Lischke
Votes: 0
Answers: 1