title: How to reset jsDOM functions which has been overwritten
body: <p>I am overwriting jsdom localstorage API like this in jest, so as to test my try catch code.</p>
  <pre><code>    Storage.prototype.setItem = jest.fn(() =&gt; {
          throw new Error(&quot;error&quot;);
      });
  </code></pre>
  <p>How do  reset its implementation ?</p>
  <p>I am presently doing this. Is there a cleaner way to do this ?</p>
  <pre><code>    const setImplementation = Storage.prototype.setItem;
      Storage.prototype.setItem = jest.fn(() =&gt; {
          throw new Error(&quot;error&quot;);
      });
      expect(() =&gt; {
          localStorageHelper.setData(key, value);
      }).not.toThrow();
      Storage.prototype.setItem = setImplementation;
      done();
  </code></pre>