Actually in AngularJS Dependency Injection uses the ‘last wins’ rule. So you can define your service in your test just after including your module and dependencies, and then when service A that you’re testing will request service B using DI, AngularJS will give mocked version of service B.
This is often is done by defining new module like MyAppMocks, putting mocked services/values there and then just adding this module as dependency.
Kind of (schematically):
beforeEach(function() {
angular.module('MyAppMocks',[]).service('B', ...));
angular.module('Test',['MyApp','MyAppMocks']);
...