Chapter - 11 Async Test - Part -I

preview_player
Показать описание
Jasmine Done(In video at - 10:30) -
1. Jasmine has a built-in way to handle async code and that’s passed to beforeEach(), afterEach() and it() test methods and is called done() callback.
2. done() callback are responsible for chaining promises, handling errors, and calling done() at the appropriate moments.
3. The test specs are completed after the invocation of done() callback and this is its primary feature.

Async..WhenStable (In video at - 14:30) -
1. Wraps a test function in an asynchronous test zone.
2. Whenstable helps us to test promises by allowing us to wait until all the promises have completed.
Рекомендации по теме
Комментарии
Автор

Audio sucks. Unable to hear and understand the concept even after using earphones.

mohammedparveez
Автор

worst mic. You should use a better mic

dhanshreemaroti
Автор

Hi Sir,

In Angular 10.1.0, waitForAsync() has replaced async().
So, when I am using waitForAsync(), my test case has failed in below test case.

fit('should test filter product list "using waitForAsync"', waitForAsync(() => {
component.searchText = 'sweet';
let productSpy = spyOn(karmaService,

fixture.whenStable().then(() => {
fixture.detectChanges();
const value =

});
}));

my product list is -
productList = [
{"title":"eggs", "type":"dairy", "price":20},
{"title":"sweet", "type":"fruits", "price":20.5},
];

agrawaldk
Автор

Great video..
Is this course available for purchase..Please let me know

RaghuPrasadKonandur
Автор

Hey All, If you want me to make a video on specific topic please let me know.

RudraTech
Автор

Sir, thanks for making a video on private method. I have made my all method private in component. Like in this video ur are writing test for I have made a private function in component and in that calling my services this.myservie.subscrube. pls let me know how to call private method in spyon. Or other way pls suggest.

AnupKumar-xznn