No video

Is reactive code with RxJS too hard to test?

  Рет қаралды 9,331

Joshua Morony

Joshua Morony

Күн бұрын

Пікірлер: 27
@JoshuaMorony
@JoshuaMorony Жыл бұрын
Join my mailing list for more exclusive content and access to the archive of my private tips of the week: mobirony.ck.page/4a331b9076
@richiekosher6218
@richiekosher6218 Жыл бұрын
so nice to have someone go beyond "create a todo-list-app with randomframework in 5 minutes" and really explain topics beyond
@saylorsedell2380
@saylorsedell2380 Жыл бұрын
Liked, subscribed and very grateful for an awesome video! The observer-spy sounds like a game-changer so will definitely look into it! Also your photo's remind me of the various emotional state a programmer goes through while writing tests XD
@matiasmiraballes9240
@matiasmiraballes9240 Жыл бұрын
this video is just in time. I was just trying to figure out how to use observer-spy. Thanks, great video as always
@emeraldelnas4833
@emeraldelnas4833 Жыл бұрын
Great video again! Do you have a tutorial about testing for beginners?
@JoshuaMorony
@JoshuaMorony Жыл бұрын
I have a few different videos about testing on my channel, some of them are a bit older now. The only "proper" guide to testing I have is this module on Elite Ionic: eliteionic.com/modules/test-driven-development/ some of the lessons are free but it is part of a paid course
@Supaship6000
@Supaship6000 Жыл бұрын
Killing it with these videos!!
@Charon061
@Charon061 Жыл бұрын
Could you provide link to repo. I want to check testing with marbles on yours use case
@JoshuaMorony
@JoshuaMorony Жыл бұрын
Which one were you interested in? There's a bunch of different repos I'm showing in this video
@Charon061
@Charon061 Жыл бұрын
@@JoshuaMorony That one with `Complex Stream`
@JoshuaMorony
@JoshuaMorony Жыл бұрын
@@Charon061 sure: github.com/joshuamorony/ionicstart-snapaday/blob/insta-story-v2/src/app/slideshow/slideshow.component.ts
@asiacarter359
@asiacarter359 Жыл бұрын
@@JoshuaMorony Would you mind linking the repo for the LoginStore spec example?
@DavidWeiss2
@DavidWeiss2 Жыл бұрын
Thanks!
@jonathangamble
@jonathangamble Жыл бұрын
you should put an underscore in front of index since you're not using the first parameter
@asatorftw
@asatorftw Жыл бұрын
Do you have a video on choosing when to use ngrx component store vs global store? Im experimented a bit with component store recently but cant rly think of a scenario that I cant handle smoother with global store. Mostly because im missing actions.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
For me it's just always Component Store until Store becomes apparently necessary, but for me I never run into those situations - I think the benefit usually comes up more in larger teams with more complex apps, and I am generally just developing alone. However, if you are productive with Store and like using it, then I think there is no reason not to use it even for the most simple circumstances (although it still probably makes sense to use Component Store for state that is local to just a single component - but again, that's up to you).
@MattBodman
@MattBodman Жыл бұрын
Wondering if you've started testing Angular with Cypress yet?
@JoshuaMorony
@JoshuaMorony Жыл бұрын
I've been doing E2E tests with Cypress in Angular for a long time, but I haven't touched component testing with Cypress yet
@MattBodman
@MattBodman Жыл бұрын
@@JoshuaMorony have you made videos on Cypress?
@JoshuaMorony
@JoshuaMorony Жыл бұрын
@@MattBodman I have a few where I use Cypress like this one: kzfaq.info/get/bejne/q8uWetCDyK_RY5c.html generally any of my videos on TDD or E2E - but I don't really have a deep dive into how Cypress works or anything like that
@michaelfaith
@michaelfaith Жыл бұрын
Nice video. But I think the one big flaw of the approach in the last example is that it requires all the Subjects to be public, when, traditionally, i think they should be private. Do you have a solution for when the Subjects are private?
@JoshuaMorony
@JoshuaMorony Жыл бұрын
I make a point to never change my code to make the tests viable, and often you do run into situations like this where you can't access something because it is private - but then I always just change the test because with the black box style approach I shouldn't need to access private things. In this case, the subjects are actually meant to be public as I am next-ing them from the template. However, if they were private and say I had methods being called from the template instead then I would either just trigger that method instead of nexting the subject, or I could also trigger the click handler in the template if I wanted to as well.
@michaelfaith
@michaelfaith Жыл бұрын
@@JoshuaMorony Solid answer. I think with the recent update of making protected members accessible by the template, it seems like even in this case, those subjects could be protected and hard to get to, which I guess would just leave triggering the clicks as your input to the test?
@JoshuaMorony
@JoshuaMorony Жыл бұрын
@@michaelfaith yes I think that would be the most correct way to do it (triggering a click) as that is how it would actually be interacted with, my approach at the moment makes the tests a bit easier/nicer to write but also run the risk of being bitten by a refactor (i.e. if a code reviewer like yourself wanted to make those class members protected before merging lol)
@pedrofernandes2005
@pedrofernandes2005 Жыл бұрын
I'm assuming you are using NX because "standard" Angular does not have Jest. So for a lot of people this might be even more confusing because the testing methods are not exactly the same.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
The apps in this video aren't using Nx, but yes Jest was installed separately using the briebug schematic
RxJS made my code 5x shorter... but is it better?
12:48
Joshua Morony
Рет қаралды 18 М.
ngTemplateOutlet is WAY more useful than I realised
16:36
Joshua Morony
Рет қаралды 74 М.
The Joker kisses Harley Quinn underwater!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 6 МЛН
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
What building with TDD actually looks like
15:38
Joshua Morony
Рет қаралды 6 М.
Angular Interview Question  - Unit Testing  - Step by Step - Part 1
37:56
Kumar Programming
Рет қаралды 3,1 М.
Elon Musk fires employees in twitter meeting DUB
1:58
GeoMFilms
Рет қаралды 15 МЛН
2 hours to build this!? Is TDD in Angular really worth it?
18:32
Joshua Morony
Рет қаралды 9 М.
WTF is a HOT observable?
9:15
Joshua Morony
Рет қаралды 16 М.
I only ever use *these* RxJS operators to code reactively
25:25
Joshua Morony
Рет қаралды 127 М.
The secret to understanding piped operators in RxJS (Advanced)
9:06