How do test code using inject()

  Рет қаралды 1,479

Rainer Hahnekamp

Rainer Hahnekamp

Күн бұрын

Пікірлер: 13
@PatriciaMolnar-b2n
@PatriciaMolnar-b2n 11 күн бұрын
Thank you for sharing your knowledge!
@RainerHahnekamp
@RainerHahnekamp 10 күн бұрын
You're very welcome.
@sander-s
@sander-s 7 ай бұрын
Interesting. I’ve been using the parameter-declarator approach for years already. I was aware of the inject function and use that approach for Testing. Now finally I understand the background of these implementations after watching your video. Thank you for providing your the video.
@RainerHahnekamp
@RainerHahnekamp 7 ай бұрын
You are very welcome. It seems like that the explanation at the very beginning is even more valuable than the acutal testing :D
@vutruong4164
@vutruong4164 7 ай бұрын
indeed I find the technical background of the inject function very rewarding to know, since it is what I would need to convince my teammates to choose 1 approach over the other. You are killing it with this testing series. A lot of new stuff come out for Angular, but I believe the testing documentation has not caught up fast enough.
@RainerHahnekamp
@RainerHahnekamp 7 ай бұрын
Thanks a lot, I was hoping that my explanation at the very beginning is of help. Have these discussions about inject all the time ;)
@yaibanoutsukushii
@yaibanoutsukushii 7 ай бұрын
great video! I wish I knew about it earlier, I needed like days to find out how to test inject() in functional resolvers...
@RainerHahnekamp
@RainerHahnekamp 7 ай бұрын
Thanks, yeah, sometimes these things are easier than it seems :)
@paulh6933
@paulh6933 7 ай бұрын
Another excellent video on testing
@RainerHahnekamp
@RainerHahnekamp 7 ай бұрын
Thanks very much Paul. Next one will come out tomorrow!
@sachindanielvarkey2377
@sachindanielvarkey2377 2 ай бұрын
Thanks for the video Rainer, One question on this is if I use the DI function imported in some service/component and try to mock the function in the unit test spec it still gives me the ng0203 error. Try to run in the runIninjectioncontext() still showing the inject() error for ng0203.
@RainerHahnekamp
@RainerHahnekamp 2 ай бұрын
Hey, what exactly do you try to mock? Do you maybe have a code example?
How do I test Signals (signal / computed / effect)
20:15
Rainer Hahnekamp
Рет қаралды 3,6 М.
Reactive Contexts
12:10
Rainer Hahnekamp
Рет қаралды 2,9 М.
Хасанның өзі эфирге шықты! “Қылмыстық топқа қатысым жоқ” дейді. Талғарда не болды? Халық сене ме?
09:25
Демократиялы Қазақстан / Демократический Казахстан
Рет қаралды 343 М.
Good teacher wows kids with practical examples #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 13 МЛН
Как не носить с собой вещи
00:31
Miracle
Рет қаралды 894 М.
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 97 М.
Why I decided to switch to the inject() function in Angular
6:10
Joshua Morony
Рет қаралды 59 М.
Python TDD Workflow - Unit Testing Code Example for Beginners
25:33
Python Simplified
Рет қаралды 79 М.
How do I test and mock Standalone Components
12:29
Rainer Hahnekamp
Рет қаралды 3 М.
Angular's Change Detection
27:31
Rainer Hahnekamp
Рет қаралды 7 М.
Angular's effect(): Use Cases & Enforced Asynchrony
33:54
Rainer Hahnekamp
Рет қаралды 3,7 М.
Learn Dependency Injection and Write Better Code
21:52
Amigoscode
Рет қаралды 174 М.
NgRx Signal Store: The Release
46:35
Rainer Hahnekamp
Рет қаралды 7 М.
JavaScript Visualized - Execution Contexts
11:41
Lydia Hallie
Рет қаралды 63 М.
Хасанның өзі эфирге шықты! “Қылмыстық топқа қатысым жоқ” дейді. Талғарда не болды? Халық сене ме?
09:25
Демократиялы Қазақстан / Демократический Казахстан
Рет қаралды 343 М.