Bro, small doubt. So, if we don't use spyOn, the function in Shared Service is executed. But by using spyOn, we can test multiply functionality without actually executing/invoking function in Shared Service. Is my understanding correct? Is this the advantage of using spyOn? I mean, it enables us to test the actual core functionality like multiply without actually executing function of a dependency/dependent service? So, spyOn is similar to mocking in other unit testing frameworks right?
@@WebTechTalkThank you bro. I have one more question. In this case, what is the difference between spyOn and createSpyObject? Both are used for mocking? In what scenarios we use createSpyObject and what scenarios we use spyOn? As per my understanding, createSpyObject is used to prevent execution of any logic in the constructor of shared/dependency service. Is that the only difference or advantage of createSpyObject over spyOn? Should we always prefer to use createSpyObject over spyOn?
@@tejap7308 To use a spyOn there should be a function available. But createSpy can be used to create a mock method. And one advantage of spyOn is, even we can call the original method if needed using callThrough method.
HI Sir, Could you please cover this series on Angular15v....There is a difference in folder structure and unable to see test.ts file in 15v ...if possible can you please provide detail explanation on latest version...so that it will help us to in our future..TIA Sir
Sorry, I have already prepared the entire series using this version. Only editing is pending. According to me, it is not recommended to switch to the latest version immediately. I always use 1 or 2 versions lower than the latest one. I will try to cover the differences separately.
Sir, Could you make similar series on Jest testing. I couldn't find any new series that properly teach that on TH-cam. mos of the series is 2-3 years old. And there is one series but his teaching skill is not good as you. So, Please cover this topic.
you are too fast. This is not beginner friendly. I have to skip from this 2nd video as I can't track you down from where to where you moved too fast. Better to remake it and make it more beginner friendly way. Thanks.
Link to the Angular Unit Testing Introduction: th-cam.com/video/emnwsVy8wRs/w-d-xo.html
thanks for such wonderful series don't loose hope sir we are with you > :
Thank you very much bro
Bro, small doubt. So, if we don't use spyOn, the function in Shared Service is executed. But by using spyOn, we can test multiply functionality without actually executing/invoking function in Shared Service. Is my understanding correct? Is this the advantage of using spyOn? I mean, it enables us to test the actual core functionality like multiply without actually executing function of a dependency/dependent service? So, spyOn is similar to mocking in other unit testing frameworks right?
Yes. That is right.
@@WebTechTalkThank you bro. I have one more question. In this case, what is the difference between spyOn and createSpyObject? Both are used for mocking? In what scenarios we use createSpyObject and what scenarios we use spyOn? As per my understanding, createSpyObject is used to prevent execution of any logic in the constructor of shared/dependency service. Is that the only difference or advantage of createSpyObject over spyOn? Should we always prefer to use createSpyObject over spyOn?
@@tejap7308 To use a spyOn there should be a function available. But createSpy can be used to create a mock method. And one advantage of spyOn is, even we can call the original method if needed using callThrough method.
@@WebTechTalk Got it. Awesome bro. Thanks a lot for your response. Your content has helped me a lot in enhancing my Angular knowledge 👍
@@tejap7308 Thank you :)
HI Sir, Could you please cover this series on Angular15v....There is a difference in folder structure and unable to see test.ts file in 15v ...if possible can you please provide detail explanation on latest version...so that it will help us to in our future..TIA Sir
Sorry, I have already prepared the entire series using this version. Only editing is pending. According to me, it is not recommended to switch to the latest version immediately. I always use 1 or 2 versions lower than the latest one. I will try to cover the differences separately.
Sir, Could you make similar series on Jest testing. I couldn't find any new series that properly teach that on TH-cam. mos of the series is 2-3 years old. And there is one series but his teaching skill is not good as you. So, Please cover this topic.
Sorry bro. I don't have experience in Jest.
First of all thanks a lot. Please create a video on http client for unit test.
Yes. It is going to be the 4th video in this series.
Your explanation is too fast. One who doesn't know Jasmine at all would get confused. Please try to be slow and clear.
Sure. Will do. Thanks.
@@WebTechTalk yeah.. it's a bit fast.. getting confused..
@@sona4612 Noted. I will consider this in my upcoming videos. Thanks
not sure if it just me, but I feel the speaker is rushing. Couldnt grap the concept.
Sorry to hear this
you are too fast. This is not beginner friendly. I have to skip from this 2nd video as I can't track you down from where to where you moved too fast. Better to remake it and make it more beginner friendly way.
Thanks.
Sorry about that. I will try to remake it as part of another series
Agreed, I started learning but cannot understand a thing after spyOn started. Moving to other tutorial