Currently conducting the following examination:
it("should receive rejection", async done => {
class someTest {
async run(){
return this.rejectFunc();
}
async rejectFunc(){
return new Promise( (_,reject)=>{
setTimeout(()=>{
reject()
},300)
})
}
}
const test = new someTest();
spyOn(test, 'rejectFunc').and.callThrough();
test.run()
await expectAsync(test.rejectFunc).toBeRejected();
done();
});
However, encountering a failure due to timeout:
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
Where is the error in my approach? The goal is to execute the run
process and confirm that rejectFunc
results in rejection.