title: AfterAll Uncaught TypeError: localStorage.removeItem is not a function thrown
body: <p>I am new to Angular testing, so i have tested small events and function but now working with fake localStorage while testing i am facing this issue <code>localStorage.removeitem</code> in every component. I have googled this issue but could't get the best possible solution. Can anyone help to overcome this problem.</p>
  
  <p>This is how i mock the local storage for testing.</p>
  
  <pre><code>let store = {''}; // i have localData here
  
      const mockLocalStorage = {
          getItem: (key: string): string =&gt; {
          return key in store ? store[key] : null;
          },
          setItem: (key: string, value: string) =&gt; {
          store[key] = `${value}`;
          },
          removeItem: (key: string) =&gt; {
          delete store[key];
          },
          clear: () =&gt; {
              this.store = {};
          }
      };
  
      spyOn(localStorage, 'getItem')
          .and.callFake(mockLocalStorage.getItem);
      spyOn(localStorage, 'setItem')
          .and.callFake(mockLocalStorage.setItem);
      // spyOn(localStorage, 'removeItem')
      //     .and.callFake(mockLocalStorage.removeItem);
      spyOn(localStorage, 'clear')
          .and.callFake(mockLocalStorage.clear);
  </code></pre>