Angular ships a full testing setup (Jasmine + Karma by default, though many teams use Jest). It provides TestBed to configure a testing module and instantiate components/services with their dependencies — leveraging DI to inject mocks.
Testing a service (simplest)
(, {
: ;
: ;
( {
.({
: [],
: [],
});
service = .();
httpMock = .();
});
(, {
service.().( (users.).());
req = httpMock.();
req.([{ : }, { : }]);
});
});
