QUnit isn't running manually namespaced setup code like I would expect?

前端 未结 1 1201
小鲜肉
小鲜肉 2021-01-29 03:31

In stuff.js:

function init() {
    return \"works\";
}

(function(ParentNamespace) {
    ParentNamespace.MySubNamespace = {};
})(window.MyNamespace || (window.My         


        
相关标签:
1条回答
  • 2021-01-29 03:43

    I have changed the test. Following test works...

    /// <reference path="../../../project1/Shared/sub1/Javascript/stuff.js" />
    test("foo test", function () {
    deepEqual(init(), "works", "couldn't access source JS file");
    ok(window, "no window context");    
    ok('MyNamespace' in window, "namespace is bad");    
    ok('MySubNamespace' in window.MyNamespace, "subnamespace is bad");
    });
    
    0 讨论(0)
提交回复
热议问题