</code> function:</p>
<pre><code class="lang-js">angular.module(&#39;myModule&#39;, []).config([&#39;$provide&#39;, function($provide) {
$provide.factory(&#39;serviceId&#39;, function() {
  var shinyNewServiceInstance;
  // factory function body that constructs shinyNewServiceInstance
  return shinyNewServiceInstance;
});
}]);
</code></pre>
<p>This technique is often used in unit tests to mock out a service&#39;s dependencies.</p>
<h2 id="unit-testing">Unit Testing</h2>
<p>The following is a unit test for t