title: How to unit-test an AngularJS service that uses localStorage internally
body: <p>How do I unit-test a factory that uses <code>$window.localStorage</code> internally using Jasmine and ngMock? </p>
  
  <p>Here's something similar to what I have:</p>
  
  <pre><code>myApp.factory('myData',function ($window) {
      return { 
          message: $window.localStorage['stuff'] 
      }
  });
  </code></pre>
  
  <p>Thanks a bunch!</p>