title: How to test Third party library functions in angular unit testing
body: <p>I am testing angular services using angular unit testing with karma and jasmine . 
  In my services I have used sprintf() of sprintf-js module to get the generate string . Now when I tried to test service it gives <strong>error sprintf not defined</strong> . </p>
  
  <p>code is something like this :</p>
  
  <p><strong>myservice.js</strong></p>
  
  <pre><code>abc(a,b){
  var url = sprintf(a,b);
  ajax.get(url);
  }
  </code></pre>
  
  <p><strong>myservice.spec.js</strong> : I have injected the myservice in this file and used it -</p>
  
  <pre><code>myservice.abc(dummya, dummyb);
  
  $rootScope.$appy();
  
  expect(myservice.abc).toHaveBeenCalled();
  
  Any help appreciated .
  </code></pre>