I call a async function in useEffect
const [documents, setDocuments] = useState(Array());
async function findDocuments() {
const res = await findDocumentList([], {});
setDocuments(res.data);
}
useEffect(() => {
findDocuments();
}, []);
I'm seeing state not covered
issue in my coverage report.
How can I fix this issue?
Thanks in advance
The coverage report needs every async function to have an await on it: await findDocuments()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.