8. Mocking the injected service using createSpyObj method and spy on the methods - Angular

8. Mocking the injected service using createSpyObj method and spy on the methods - Angular

Leela Web Dev

2 года назад

20,133 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Akash Karn
Akash Karn - 11.05.2023 15:21

Thanks so much Leelaaaaaaaa

Ответить
Srungarapu Saikrishna
Srungarapu Saikrishna - 06.01.2023 08:57

What if we have to spy a whole service instead of a single method inside it? Should I put all the methods as arguments or is there any other way

Ответить
Venator
Venator - 11.11.2022 22:03

My fried thinx for video do you know how to mock imported function from another module . Maybe inject into testbed of something else . Function not in service not in component it just imported to the tested component

Ответить
Armen Stepanyan
Armen Stepanyan - 01.11.2022 14:26

nice videos, thanks

Ответить
Rutuja Gurnule
Rutuja Gurnule - 21.10.2022 07:13

If there is an empty constructor in service.ts then we can remove it because in sonarqube it’s showing critical issue

Ответить
rahul mukherjee
rahul mukherjee - 21.09.2022 17:49

Hi leela,

So the createSpyObj creates an instance of the service speficied? Or it does'nt?

Ответить
MUGATU
MUGATU - 20.09.2022 11:40

excellent video, you should take advantage from Proxy object iin order to intercept operation in that object, like let proxy = new Proxy(target, handler), very powefull feature

Ответить
NIPUN Jain
NIPUN Jain - 05.05.2022 19:15

Really awesome lectures, Thankyou very much for detailed explanation

Ответить
Bessam Haj Salem
Bessam Haj Salem - 04.04.2022 17:33

Hello Sir thank you for the explanations, i didn't understand how if we call the Loggerservice and the log method jasmine recognize that we are talking about the real Loggerservice cause if i change the string here jasmine.createSpyObj('AnystringService', ['log']); it will give the same result, thank you so much sir

Ответить
srivishal sangepu
srivishal sangepu - 03.04.2022 20:36

Thank You so much, Very clean explanation.

Ответить