Learn How to Unit Test Angular's 17 Defer Block

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

Code Shots With Profanis

Code Shots With Profanis

Күн бұрын

Пікірлер: 12
@CodeShotsWithProfanis
@CodeShotsWithProfanis 10 ай бұрын
It's always a challenge to create a video for a feature that is currently under development preview. Having said that, the default `DeferBlockBehavior` changed from Manual to `Playthrough` via this commit github.com/angular/angular/pull/53956. It's a great change since in most cases, as you will see in this video, the Playthrough is the winning option.
@paulh6933
@paulh6933 10 ай бұрын
Sorry, let me be a little more explicit. I think testing has been in the background, not much attention to it. Now we are seeing Cypress and Playwright making large strides. We also saw standalone. All of these making testing easier and more "enjoyable" (yea that might be a stretch). So I am eager to see more testing enhancements.
@madpwnz
@madpwnz 10 ай бұрын
Cheers for the video mate.
@balintcsaszar6831
@balintcsaszar6831 10 ай бұрын
Nice, and do you perhaps in idea how we can mock components inside @defer blocks? When I talk about mocking components, I don't want to mock child component deps as well. I hoped ng-mocks helps me but not really
@CodeShotsWithProfanis
@CodeShotsWithProfanis 10 ай бұрын
Can you elaborate a bit more with an example?
@balintcsaszar6831
@balintcsaszar6831 10 ай бұрын
@@CodeShotsWithProfanis @defer { } @placeholder { } where the parent and the child are standalone, child has a service dependency and when I'm testing the parent component I would like to mock the child ofc because it is unit test. Before I used MockComponent() from ng-mocks. Is it understandable now?
@CodeShotsWithProfanis
@CodeShotsWithProfanis 10 ай бұрын
@@balintcsaszar6831 Can you try this? await TestBed.configureTestingModule({ deferBlockBehavior: DeferBlockBehavior.Playthrough, imports: [ParentComponent, MockComponent(ChildComponent)], }).compileComponents(); It seems that ng-mocks works fine
@paulh6933
@paulh6933 10 ай бұрын
Are you using the new @web/test-runner?
@CodeShotsWithProfanis
@CodeShotsWithProfanis 10 ай бұрын
In that video I am using karma but you can check this short video were I use web-test-runner kzbin.info2lLS6KEd_14
@paulh6933
@paulh6933 10 ай бұрын
Thanks I heard Karma was being deprecated. It will be interesting to see more on this topic
@CodeShotsWithProfanis
@CodeShotsWithProfanis 10 ай бұрын
​@@paulh6933 There is also the alternative of Jest which is supported by Angular. There is a build for that. I could generate a video explaining this transition
Local Change Detection in Angular is easy with Signals
10:40
Code Shots With Profanis
Рет қаралды 2,7 М.
Pytest Tutorial - How to Test Python Code
1:28:39
freeCodeCamp.org
Рет қаралды 218 М.
Can You Find Hulk's True Love? Real vs Fake Girlfriend Challenge | Roblox 3D
00:24
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 59 МЛН
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 94 МЛН
Setting up the Development Environment
1:02:16
Coding In Colour
Рет қаралды 67
Design patterns in React
14:37
Cosden Solutions
Рет қаралды 176 М.
Learn How to Use Angular's 17 Defer Block
23:50
Code Shots With Profanis
Рет қаралды 4,1 М.
Unit Test Those Tricky Angular Functional Guards   - Here's How!
16:55
Code Shots With Profanis
Рет қаралды 4,2 М.
The ONLY REASON To Unit Test
8:26
Theo - t3․gg
Рет қаралды 84 М.
Learn Python Debugging in VS Code - Under 5 Minutes!
4:29
Volkov Dev
Рет қаралды 101
Get to Know the Model Input Function in Angular 17
10:17
Code Shots With Profanis
Рет қаралды 1,3 М.
Deferrable views in Angularv17
6:04
Angular
Рет қаралды 23 М.
Get to Know Signal Queries in Angular 17
17:43
Code Shots With Profanis
Рет қаралды 1,9 М.
Learn How to Unit Test Angular Components with RouterTestingHarness
29:54
Code Shots With Profanis
Рет қаралды 2,9 М.
Can You Find Hulk's True Love? Real vs Fake Girlfriend Challenge | Roblox 3D
00:24