Sunday, 25 August 2013

Ember.js & QUnit : \"TypeError: Object # has no method \'getHandler\'\" when calling visit

Ember.js & QUnit : \"TypeError: Object # has no method \'getHandler\'\" when calling visit References I\'m getting an error when using visit in a test : TypeError: Object # has no method \'getHandler\' module(\"visit\", { setup: function() { Ember.run(App, App.advanceReadiness); }, teardown: function() { App.reset(); } }); test(\"visit works\", function () { expect(2); // this gets executed equal(1, 1); return visit(\"/\").then(function() { // this never equal(1, 1); }); }); The resulting error trace is : Died on test #2 at eval (eval at (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066)), :10:1) at eval (native) at eval (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066), :2:14066) at Function.p.extend.globalEval (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066), :2:14077) at p.ajaxSetup.converters.text script (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066), :2:83767) at cC (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066), :2:5874) at y (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066), :2:79888) at d (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066), :2:85578): Object # has no method \'getHandler\' Source: TypeError: Object # has no method \'getHandler\' at generateHandlerInfos (eval at (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066)), :25824:31) at performTransition (eval at (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066)), :25758:30) at createURLTransition (eval at (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066)), :25501:18) at doTransition (eval at (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066)), :26067:20) at Object.Router.handleURL (eval at (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066)), :25213:20) at Ember.Router.Ember.Object.extend._doTransition (eval at (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066)), :26491:53) at Ember.Router.Ember.Object.extend.handleURL (eval at (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066)), :26331:21) at Ember.Application.Ember.Namespace.extend.handleURL (eval at (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066)), :30240:16) at Object.Backburner.run (eval at (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066)), :4862:30) at Object.Ember.run (eval at (eval at (http://127.0.0.1:3000/javascripts/libs/jquery/jquery-1.8.0.min.js:2:14066)), :5200:30) I\'ve made sure Ember is loaded before the tests are run as suggested in this answer. QUnit is also working properly as a basic test on fixtures is working. I\'ve now spent hours on this issue and I don\'t have any clue why this is happening.

No comments:

Post a Comment