Thank you for this awesome tutorial, extremely helpful for unit testing my nestjs application 🙏🏻
@dawid_dahl2 жыл бұрын
Instant subscription! Thank you so much for making this series. 🙏🏻
@netsudroАй бұрын
Thank you! I am new to NestJs, still learning, But this feels like writing 40 lines of code to test 4 lines of code. I guess testing will get better in the future with AI.
@bharatsaraswat2 жыл бұрын
Great session! Thank you, very much understandable. Please recommend any resources for further learning
@kidneygod644 Жыл бұрын
great tutorial
@unhandledexception1948 Жыл бұрын
Excellent… any chance you can create a video for testing guards or decorators
@ansonthedev Жыл бұрын
Unit Testing Guards are the same way you'd unit test every function. You test the Guards logic. If you want to test the Guard with the Controller, that would be considered a Functional test or close to an integration test where you can use tools like supertest to call the API endpoint with certain parameters to ensure the guard is working. Check out my E2E testing video for NestJS.
@unhandledexception1948 Жыл бұрын
@@ansonthedev Yes, I was referring to testing the guard along with the controller, thanks for pointing out the correct video... will look at the E2E approach :-)
@od1ez9 ай бұрын
Is it possible to do controller unit tests with services dependencies with databases repositories? - it always asking about to give it all dependencies
@vijaymanohar4710 ай бұрын
Thanks @ansonthedev. Can you please post a video regarding nestjsx/crud (getMany, getOne etc...)
@CristianFlores-rj3ny2 жыл бұрын
What a nice video bro! u save my life !
@dimitrisbellos017 ай бұрын
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.
@tobiasjuhre Жыл бұрын
Can i generate the .spec.ts file later? The person which created the controller, did not generate the .spec.ts file for it.
@TheFabulousCube Жыл бұрын
Nope. You have to create one manually. You can create a new controller, steal the .spec.ts file for your own, then delete the new controller. That will give you the boilerplate tests, you just have to rename everything. (It's easier if you wisely name your new controller something like "ExistingController2" and remove all the '2's)
@artursargsyan43773 жыл бұрын
Can you make a video with unit testing the grpc methods? Thank You