Angular unit testing using Jest

preview_player
Показать описание
This video gives you the in depth knowledge of writing unit test cases for Angular applications using Jest.

Рекомендации по теме
Комментарии
Автор

INTRO

0:00 project introduction
4:10 file structure
8:23 jest configurations



WRITING TESTS FOR SPECIFIC FILES
9:25 app.component.ts
12:02 about.component.ts (static component + html testing)
14:32 login.component.ts (angular lifecycle + reactive form)
19:40 auth.service.ts (service testing + observable testing)
24:54 authguard.service.ts
28:23 expense.service.ts (api call and response)
38:25 addexpense.component.ts (route params + reactive form)
47:09 report.component.ts
58:04 viewexpense.component.ts
1:02:43 user.service.ts
1:03:43 logout.component.ts
1:05:09 password.component.ts
1:09:56 profile.component.ts + register.component.ts

WRAPPING UP
1:10:08 checking code coverage

anacostaeduardo
Автор

Fantastic video. I'm really glad you made this. It helped me understand testing angular with jest. 🇬🇧

michaelt
Автор

Thanks for this video Akhilesh, it's a nice hands on testing with Jest that shows how easy and powerful Jest is, wonder if there's a more opinionated way of doing Angular Testing with Jest. Great Video!! hope I can see more !

oscarsangularchannel
Автор

Thanks Akhilesh. Great video. Very useful! I really appreciate your effort to create it.

kevorkyerevanian
Автор

Why is it that a lot of the mock objects and services had type of "any?" I thought we wanted to type them as much as possible, even in the test.

GuillermoArellano
Автор

If you writing logic inside your spec, like setting and clearing the localStorage and then checking the outcome, how does it actually test the functionality?

SayantanDeyIshanz
Автор

you remind me of my maths teacher who just reading line by line without knowing the logic .. LOL :D and not responding to the questions only giving likes to people who liked it :D

MahiXI
Автор

I'm searching for something this clear since 2 two days... Honestly a huge thanks 😵

meliecool
Автор

Thanks for this video Akhilesh, really helpful!

ernestoscaringicelestino
Автор

Great explanation . Good for new comers 👍👌

gopibollisetti
Автор

is there any example on material table test with jest

vijayg
Автор

Nice Tutorial Akhilesh, In our project we are using Jest with Angular and we are unable to pass the test case where moment function is used. Can you help me on this.

d.santoshkumar
Автор

Not explained reasons of why something used and when to use

devvio
Автор

Really useful Test case !!! but can we have more complex test case then this

rameshmahajan
Автор

You didn't explain a single line of code in this video! You are just copy pasting code and reading them as it is. This is why we need dislike counter on YouTube.

abhijeetdey
Автор

Why r u even copy pasting the code.. Why not have the whole code written and just explain and jog over the lines.. Pathetic way of teaching. So fast not understanding anything

BlueBoysTune
Автор

Very nice tutorial. I have a small question. Could you show me a way to create the Spy on BehaviourSubject which is mentioned in a service file?

Actually I am using this service in a component. When I am actually calling I am getting "Typescript Error : can not read property getValue of undefined".

Any suggestions please?

pamuletipullagura
Автор

There are a lot of trash. One example: fixture.userObj = authServiceMock.currentUser; What do you test? )

denisbielishev