(function(context, $) { context.JKTestUtils = { loadFixtures: function(path) { //path = 'file:///home/jonathon/dev/jamkazam/jam-web' + path; //path = 'http://localhost:9876' + path; var needTestFixtures = ($('#test-fixtures').length === 0); if (needTestFixtures) { $('body').append('
'); } $.ajax({ url:path, async: false, success: function(r) { $('#test-fixtures').append(r); }, error: function(jqXHR, textStatus, errorThrown) { // Assumes we're in a jasmine context throw 'loadFixtures error: ' + path + ': ' + errorThrown; } }); }, removeFixtures: function() { $('#test-fixtures').remove(); } }; })(window, jQuery);