Posts

Showing posts from January, 2026

Mocking httpResource in Angular

httpResource  is still experimental in Angular, and I've begun playing around with it. Once I got a working implementation on a simple form, I wanted to update my tests. This was challenging. I did some searching and found a couple of posts about using HttpTestingController  and mocking a response, but I wanted to retain the service-level abstraction in my component unit tests, which know nothing about HTTP, only that services are used, and one of them now returns an HttpResourceRef in place of an Observable. Here's the mock implementation I wrote. I'm using Vitest now in this project instead of Jasmine, but the syntax should hopefully still make sense. class ExerciseServiceMock {   get = vi . fn (). mockImplementation (() => {       const paginatedResults = new PaginatedResults < ExerciseDTO >();       paginatedResults . totalCount = 0 ;       paginatedResults . results = new Array < ExerciseDTO >(...

The 10 Lowest Rated Movies on My NAS

Image
One of my hobbies for a long time now has been the building of a digital library of movies and TV shows. I originally undertook this using media stored on a combination of USB drives and a DLNA server, but just over a year ago purchased a NAS and hosted an instance of Jellyfin . Jellyfin is amazing and I plan to write a separate entry about that later. Today, out of curiosity, I decided to see if it were possible to sort my media in order of how well it was rated (community rating/general consensus), and yes, Jellyfin provides this. And once I'd sorted my movies in order of community rating, I just had to know: What's the worst rated stuff I have here? What follows is that list, in descending order -- my "Bottom 10 Movies", so to speak. #10 - Can't Stop The Music Starring Steve Guttenberg and The Village People Is It Really That Bad?  Yes Okay, okay, I need to make something clear at the outset: I love bad movies. And this one is...woof. Bad. It's bad. It...