Jest test fails for async function that calls another async function
问题 I am trying to test an async function that uses data returned by another async function. Here is the code to explain my problem: StudentInfo.js export async function getData() { //studentData imported from another file return new Promise(resolve => { setTimeout(() => { resolve(studentData); }, 5000); }); } export async function filterStudents() { const studentData = await StudentInfo.getData(); //computations return filteredData; //object } StudentInfo.test.js import * as studentInfo from