I am trying to unittest a library I am writing so I grabbed
testrunner.js and setup a test area in my project. I use $j =
jQuery.noConflict(); throughout my library. How should I use the
testrunner with this in mind? I can only get the testrunner to assert
that my library's main object exists, as soon as I call any functions
that reference jQuery with $j, I get the dreaded:
--- console output ---
$ is not a function
[Break on this error] $("#main").html( _config.fixture );
---
I have tried to add the $j = jQuery.noConflict(); to the library
itself, in the test.html head like so:
jQuery(document).ready(function(){
var $j = jQuery.noConflict();
});
and in each test:
test("test toc stuff", function() {
var $j = jQuery.noConflict();
expect(1);
document.doc_id = 1;
ok($j, 'Test noConflict');
});
All of these attempts fail... any ideas? Do you guys do unittesting
with non-jQuery/jQuery plugin code?
Thanks,
David