Qunit test not recognizing defined object -
i have js method i'm looking test:
domediation: function() { var state, = this, mediation_rule = "asdf"; mediation.getrules(mediation_rule, function () { [blah blah] }); },
my mediation object defined above method in class. qunit test:
test('domediation: testing mediation', 1, function(){ var proto = $.extend({}, my.prototype, { mediation: { getrules: function(rule, cb){} } proto.domediation(); });
the problem i'm getting error:
died on test #1: cannot call method 'getrules' of undefined - {}
yet, defined right there in test. thanks.
turns out previously, mediation defined such: var mediation = anotherclass.mediation. in qunit test, had define anotherclass.mediation = {} instead of mediation{}
Comments
Post a Comment