NestJS Testing Tutorial | Unit and Integration Testing

preview_player
Показать описание
In this video we go over the fundamentals of writing unit, integration, e2e tests for a NestJS API application.
Рекомендации по теме
Комментарии
Автор

Your Nest videos are easily the best I've seen. Could you do another one on testing where you set up a Development database using migrations, and then only do E2E testing with the database as a part of the testing.

jon
Автор

More great content. The music is cool and soothing to start, and glad you dropped it as the 'real' content started. :)

timothymm
Автор

Brother, you are a life savior. I look for many resources but couldn't find that overriding thing. Thanks so much, brother 😁👍👍 Subs to your channel

isurumaldeniya
Автор

thanks for awesome tutorial video, watching your video with speed 1.5 is always my way for running through all of it then begin to coding :)))

cendekia
Автор

Great introduction. I've been banging my head trying to get mocking to work while using typeDI and typeORM. Might just switch my whole backend to use NestJS after watching this =)

MrSpiftire
Автор

Crystal clear as usual, Great video Marius!

alexandermarthius
Автор

Dude, you rock! Congratulations for your amazing work :)

lucascyrne
Автор

Great tutorial. Your efforts is truly appreciated

chronorus
Автор

great work, very well explained. greetings from Argentina 🔵⚪🔵

Rflexx
Автор

@Marius Espejo, how to override multiple services in createTestingModule? My controller A is dependent on service B, C, D

i_am_Avdhoot
Автор

so clear, Thank you so much would like to see more of these.

tusharroy
Автор

Great content you've provided here sir!
Just wanna leave a quick note that if you've created a custom class for your Repository you'll have to write "provide: UserRepository, " instead of "provide: getRepositoryToken(User), "
Keep up the good work!

aomadeira
Автор

Thanks a lot tried clicking the subscribe button to subscribe twice...

rukeeojigbo
Автор

I really miss git repository here :( Sometimes when you want to jump from file to file its really difficult to switch between different timestamps in video.

mrarc
Автор

thank you so much, you've put everything on the shelves.

АнтонВолков-фъ
Автор

Hey, I am looking for a setup for test suites in NestJS, but with addition of factories for classes, in order to help me with seeding and "Arrange" Step of the Test. Any idea where to watch that?
Especially, for complex schemas where i.e. I want to test a module, which every entity depends on the creation of others.

dimitrisbellos
Автор

27:10 One comment about the 'expect().toBeCalled()' assertions making the tests brittle.

They already *are* brittle, because you are implicitly relying on the underlying implementation in your choice of which methods to define in your mockUserRepostory.

For example, if you switched to using insert() and query() in the service, your mockUserRepository probably wouldn't have those methods defined, so the test would fail anyway.

For a real life project, I am needing to effectively mock a lot of prisma in this manner. I'd also potentially like to be able to inject different provider overrides for different tests: any ideas how?

Great tutorial though, thanks.

stainlesssteellemming
Автор

Hi Marius! Question, should we always create a unit test for our service? Or should we just create an integrarion test? I want my test no to be related to the implementation only on the output of the service. What do uou think?

EstebanHelgueroCardiff
Автор

Hi Marius, following your video (e2e testing), I keep getting this error: Nest can't resolve dependencies of the JwtStrategy (AuthService, ?). Please make sure that the argument ConfigService at index [1] is available in the AuthModule context.
I tried the overrideProvider for ConfigService, but no hope. Any ideas? Thank you

ahmedjumaah
Автор

any chance of the starter code so people can follow quickly without much set up

adamprice
visit shbcf.ru