Search code examples
jqueryresharperqunit

When running Qunit tests using ReSharper it cannot resolve namespace


This is my QUnit test:

/// <reference path="~/Scripts/global.js" />
    module("Global.js");

    test("Test getParameterFromQueryStringByName", function () {
        expect(1);
        equals("exist", jwd.global.getParameterFromQueryStringByName("xyz.com/web?querystring1=exist", "querystring1"), "Search Valid name from one parameter");
    });

Here jwd.global is a namespace defined in another javascript file called global.js. When I run the test from the browser by hitting some URL it works fine, but when I run the same test using ReSharper it gives me the error jwd is not defined - { "fileName": "http://localhost:49824/Tests.js", "lineNumber": 8 }.

How can I make sure that while running the qunit tests using ReSharper, it can find the jwd namespace?


Solution

  • My bad, in global.js I declared jwd.global not jwd. I had declared jwd in some other js file. After including that other js file the test runs fine.