NestJS Testing Tutorial #3 - Unit Testing with TypeORM Repositories

preview_player
Показать описание

Connect with me:

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

This was very helpful beyond my expectations! Thanks for the content.

MireilleMedhat
Автор

Thanks for a greate video, and all your great work :) I do have one question: how do you mock when you have query params?

strawberryjam
Автор

Could you possibly do an aside regarding testing with prisma 2?

jordanrenaud
Автор

first, thanks for the sharing.
I want to say though that I still find it very tedious and confusing to have the test module built and configured properly, especially if, for instance, the service files being tested has more dependencies such as importing more than one db entity and other service files from other modules. which I think is the more realistic and hands-on scenario in real-life apps.

the example you provided here is great, but I am having difficulty writing tests for a method defined in my service file, this method should also create and save a db entity.
but this db entity has a relation with other db entity, which means it cannot be created unless the owner side of the relation exist, so the problem I am facing now writing the test as described in the video is that the owner entity is "not defined".
any thoughts on that?

also I see that in order to write test for the `createUser` method, we have to write about triple the amount of code in the original method.
is this really the only way to test the functionality of it?
thanks in advance!

moswilam
Автор

Informative video, though it would be great if you edited it to remove some chaos from live-programming

maxo.
welcome to shbcf.ru