Mocking dependencies with 'spyOn'