title: How to programmatically generate a window.event using Javascript?
body: <p>I am currently unit testing some javascript, where it handles an event raised by clicking on a certain item in the window.  Below is a snipet of the code:</p>
  
  <pre><code>function someFunction() 
  {
  
      var evt = window.event ? window.event : event;
  
      if (evt == null) { return; }
  
      var nodeElement = evt.srcElement;
  
      if (nodeElement == null) { return; }
      .
      .
      .
  }
  </code></pre>
  
  <p>My current approach is to try to create a custom event in my test file which will populate window.event so I can at least get to test the nodeElement == null part.  But I am having difficulties doing so (being not from a Javascript backgound).  How do I actually create a custom event (in IE)?  I'm currently doing unit testing using JsTestDriver so no html file is used.  I do not mind using jQuery or just plain Javascript solution.</p>
  
  <p>Thanks.</p>