title: Test Case to call function on Document.ready
body: <p>My JS code is mentioned below:</p>
  
  <pre><code>if (typeof IPL === "undefined") {
      IPL = {};
  }
  
  /// &lt;summary&gt;Declare Namespace IPL.Register&lt;/summary&gt;
  if (typeof IPL.Register === "undefined") {
      IPL.Register = {};
  }
  
  $(document).ready(function () {
      IPL.Register.Print.initialize();
  });
  
  /// &lt;summary&gt;Declare Namespace IPL.Register.Print&lt;/summary&gt;
  IPL.Register.Print =
  {
      /// &lt;summary&gt;Function to call on initialize page.&lt;/summary&gt;
      initialize: function () {
          window.onload = function () {
              window.print();
          };
      }
  };
  </code></pre>
  
  <p>When I run Test case (Qunit.js and blanket.js)  as mentioned below then Document.ready function is not getting called and Code coverage not cover that line.
  Below test case works fine but it only include last lines of code and initialize function on window load.</p>
  
  <pre><code>test("initialize test", 1, function () {
      var result = IPL.Register.Print.initialize();
      equal(undefined, result, "passed");
  });
  </code></pre>
  
  <p>Someone please assist how to write Test case to execute function on document load?</p>