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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -