QUnit from within dijit widget startup

QUnit from within dijit widget startup

Hello,
I'm brand-spanking new with jQuery, but it seems to be working pretty well for my needs. I'm using it with sinon.js to test all kinds of nested dijit widgets that are loaded using AMD loading. These widgets contain and manage the tests => a boolean decides when they run or not and the execution happens after the widget's startup(), i.e. all required setups are already performed

ISSUE:
When pages with these widgets are loaded by refreshing the entire browser page (e.g. cursor in the address bar and hit enter), all works fine. But when they are loaded by clicking a link that changes the content of a dijit.layout.content pane, breakpoints show that the test suite is entered, but the individual test functions are not.

Any ideas?
Thanks

  1. define([     "dojo/_base/declare",    "uTest/qunit",    "uTest/sinon",    "uTest/sinon-qunit"],
  2. function(declare) {
  3.     return declare("nable.accounts.defaultsUnitTest", [], {
  4.         uTestSuite : function(){
  5.                module( "module A", {
  6.                     setup: function() {},
  7.                      teardown: function() {}
  8.                });
  9.             //breakpoint does get here
  10.             test( "a basic test example", function() {
  11.                   //stepping in the debugger does not get here
  12.                 var value = globalObj.memberWidget.declaredClass;
  13.                 equal( value, "blah.fnah.Config", "We expect value to be 'blah.fnah.Config'" );
  14.             });
  15.             var gaglabada = function() {
  16.                 debugger;   //does not stop here
  17.                 ok( 1 == 1, "did it or did it not pass...." );
  18.             };
  19.           //gets here fine
  20.             test( "hello test", gaglabada);             
  21.         }
  22.     });
  23. });