title: angular + jasmine + mock $stateParams in a directive
body: <p>What is the best approach to mock $stateParams in a directive?  $stateParam members will be changed according to the test.  </p>
  
  <p>I can easily mock $stateParams in a controller using $controller('ctrl', $stateParams) but dont know how to modify $stateParams that gets injected into the directive.</p>
  
  <p>I've gone the route of decorating $stateParams with the below but can only declare that when i create the module.  as i mentioned, $stateParam members will change many times through the different tests.</p>
  
  <pre><code>beforeEach(angular.mock.module(function ($provide) {
  
      $provide.provider('$stateParams', function () {
          return {
              myStateParam: true,
              myOtherStateParam: 'some text'
          };
      });
  
  }));
  </code></pre>