Nov 02

When an Angular directive test no longer needs a host component

Angular 22.2 added TestBed.createDirective, so a directive test no longer needs a component written just to hold the directive. I tested a copy-to-clipboard directive both ways. The files came out the same length, the input names lost their build-time check, and a directive that works with a parent still needed a host component.

angular · testing · 5 min
→
Sep 29

Replacing fakeAsync and tick when Angular tests move to Vitest

Angular projects generated today run their tests on Vitest with no zone.js at all, so fakeAsync and tick throw before the first assertion. The replacement is vi.useFakeTimers, and the part that costs an afternoon is that zoneless change detection schedules its own render on a timer, so fixture.whenStable() waits for a clock nobody is winding.

angular · testing · 7 min
→
Sep 02

TimeProvider: test a 30-second retry policy in 13 milliseconds

A retry policy that backs off 5s, 10s and 15s can be tested against its real schedule in about 13 milliseconds, because .NET 8's TimeProvider is accepted by the framework's own waiting primitives. The part that costs an afternoon is that a fake clock only fires the timers that already exist, so one big jump past the whole schedule leaves the run pending.

dotnet · testing · 6 min
→
Jul 28

Testcontainers: run your tests against real SQL Server and RabbitMQ

A mocked repository test proves your mock works. Testcontainers runs the real SQL Server and RabbitMQ inside the test run, so green means what you think it means.

dotnet · testing · 5 min
→