title: How to mock download attribute of a link?
body: <p>I am working on updating an app from Angular 1.2 to Angular 1.4 and in the course, broke some of the karma tests.  Most are easy fixes, however there are a few that I can't get working.  The tests rely on checking if the download attribute is defined to determine how to download the required file.  Before the upgrade, the tests could just set elem.download.  After the upgrade, I can't seem to set download.</p>
  
  <p>Here is how I'm setting up the element for the tests:</p>
  
  <pre><code>var link = document.createElement('a');
  link.download = undefined;
  </code></pre>
  
  <p>And then in the code itself, it is a very simple</p>
  
  <pre><code>if(link.download !== undefined) {
      //do stuff (this test works)
  } else {
      //do other stuff (this test doesn't work)
  }
  </code></pre>
  
  <p>When I try to set link.download to undefined, it is still going into the first branch.  If I try to just pass an empty object in, I errors because various properties are undefined, even though the code doesn't seem to be looking at those properties.</p>
  
  <p>I have also tried setting <code>link.download = null</code> and changing the if statement to use <code>typeof</code></p>
  
  <p><strong>TL;DR</strong> How do I set the download attribute to undefined?</p>
  
  <p>Here is a <a href="http://plnkr.co/edit/0JWdqjX6NyZe5u5WTmLV" rel="nofollow">simple Plunker</a> with the issue.</p>