title: jasmine + karma test runner: how to test window.location.href
body: <p>I have a service that ecapsulate the use of the <code>window</code> object:</p>
  
  <pre><code>@Injectable()
  export class WindowService {
      constructor(){};
      get window() : Window {
          return window;
      }
      get href(): string {
          return window.location.href;
      }
      set href(url: string) {
          window.location.href = url;
      }
  }
  </code></pre>
  
  <p>Then I have the following jasmine test:</p>
  
  <pre><code>describe('WindowService Test Suite', () =&gt; {
      let windowService: WindowService;
  
      beforeEach(() =&gt; { 
          windowService = new WindowService();
      });
  
      it('should set the href', () =&gt; {
          windowService.href = "/test";
          expect(windowService.href).toBe("/test");
      });
  });
  </code></pre>
  
  <p>The problem is that when I set the href, the karma redirect to the that url and lead to the others test not being runned.</p>
  
  <p>Any one could give some tip I can test this feature without being redirect?</p>