title: VS 2012 Chutzpah Adapter and Jasmine Javascript unit testing integration
body: <p>I am working to include JavaScript unit testing into an ASP.NET project that I am working on. I have installed the Chutzpah Adapter and Jasmine. After carefully following the  direction provided by <a href="http://www.youtube.com/watch?v=meJ94rAN7P8" rel="nofollow noreferrer">this Ryan Cromwell video</a> for installing and setting up the environment, I am encountering a similar error as this post for issues with <a href="https://stackoverflow.com/questions/14572919/qunit-isnt-running-manually-namespaced-setup-code-like-i-would-expect">Chutzpah and QUnit</a>, however I am using Jasmine instead of QUnit and his solution does not appear to apply, at least not in the same way. </p>
  
  <p>Here's the JavaScript being tested (WebApp.Utils.js). The function being tested is method of the WebApp.Utils "class" defined using the "Revealing Module" pattern (not sure if that's relevant or not) ...</p>
  
  <pre><code>var WebApp = (typeof WebApp === "undefined") ? { } : WebApp ;
  
  $(document).ready(function () {
  
      WebApp .Utils = (function () {
  
          var ParseDecimal = function (value, decimalPlaces) {
              /// &lt;summary&gt;Parses a number into a decimal value with the specified number of decimal places&lt;/summary&gt;
              /// &lt;param name="value" type="number"&gt;Number to parse&lt;/param&gt;
              /// &lt;param name="decimalPlaces" type="integer"&gt;Number of decimal places to parse to. &lt;/param&gt;
              ///
              return parseFloat(Math.round(value * 100) / 100).toFixed(decimalPlaces);
          }
  
          return {
  
              ParseDecimal: ParseDecimal
          }
  
      })();
  
  });
  </code></pre>
  
  <p>Here is the test written, using Jasmine to test it. File references have been verified as being correct. In fact, IntelliSense is working so I know it sees it.</p>
  
  <pre><code>/// &lt;reference path="../tools/jasmine.js" /&gt;
  /// &lt;reference path="../shared/WebApp.Utils.js" /&gt;
  /// 
  
  describe("WebApp.Utils.ParseDecimal", function () {
  
  
      it("can ParseDecimal", function () {        
          var result = WebApp.Utils.ParseDecimal(15.451222, 2);
          expect(result).toBe(15.45);
      });
  });
  </code></pre>
  
  <p>And here is the error I get is Visual Studio when I save the file and run the test.</p>
  
  <pre><code>Test Name:  WebApp.Utils can ParseDecimal
  Test FullName:  j:\projects - gary\WebApp\rc1iteration05\rc1iteration05\scripts\tests\test.js::WebApp.utils::can parsedecimal
  Test Source:    j:\projects - gary\WebApp\rc1iteration05\rc1iteration05\scripts\tests\test.js : line 7
  Test Outcome:   Failed
  Test Duration:  0:00:00.003
  
  Result Message: TypeError: 'undefined' is not an object (evaluating 'WebApp.Utils.ParseDecimal') in file:///j:/projects%20-%20gary/WebApp/rc1iteration05/rc1iteration05/scripts/tests/test.js (line 9)
          at file:///j:/projects%20-%20gary/WebApp/rc1iteration05/rc1iteration05/scripts/tests/test.js:9
          at file:///C:/USERS/GSTENSTROM/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/ADQAX1GK.5GB/TestFiles/jasmine/jasmine.js:1064
          at file:///C:/USERS/GSTENSTROM/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/ADQAX1GK.5GB/TestFiles/jasmine/jasmine.js:2096
          at file:///C:/USERS/GSTENSTROM/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/ADQAX1GK.5GB/TestFiles/jasmine/jasmine.js:2049
          at file:///C:/USERS/GSTENSTROM/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/ADQAX1GK.5GB/TestFiles/jasmine/jasmine.js:2378
          at file:///C:/USERS/GSTENSTROM/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/ADQAX1GK.5GB/TestFiles/jasmine/jasmine.js:2096
          at file:///C:/USERS/GSTENSTROM/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/ADQAX1GK.5GB/TestFiles/jasmine/jasmine.js:2049
          at file:///C:/USERS/GSTENSTROM/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/ADQAX1GK.5GB/TestFiles/jasmine/jasmine.js:2523
          at file:///C:/USERS/GSTENSTROM/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/ADQAX1GK.5GB/TestFiles/jasmine/jasmine.js:2096
          at file:///C:/USERS/GSTENSTROM/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/ADQAX1GK.5GB/TestFiles/jasmine/jasmine.js:2049
          at file:///C:/USERS/GSTENSTROM/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/ADQAX1GK.5GB/TestFiles/jasmine/jasmine.js:2145
          at file:///C:/USERS/GSTENSTROM/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/ADQAX1GK.5GB/TestFiles/jasmine/jasmine.js:802
          at startJasmine (phantomjs://webpage.evaluate():15)
          at phantomjs://webpage.evaluate():25
  </code></pre>