Bug Tracker

Changeset 5812

Show
Ignore:
Timestamp:
08/08/08 17:07:04 (4 months ago)
Author:
joern.zaefferer
Message:

qunit: replaced $ alias with jQuery (merged from jquery/test/data/testrunner.js)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/qunit/testrunner.js

    r5739 r5812  
    2727 
    2828_config.filters = location.search.length > 1 && //restrict modules/tests by get parameters 
    29         $.map( location.search.slice(1).split('&'), decodeURIComponent ); 
     29        jQuery.map( location.search.slice(1).split('&'), decodeURIComponent ); 
    3030 
    3131var isLocal = !!(window.location.protocol == 'file:'); 
    3232 
    33 $(function() { 
    34     $('#userAgent').html(navigator.userAgent); 
     33jQuery(function() { 
     34    jQuery('#userAgent').html(navigator.userAgent); 
    3535    runTest();   
    3636}); 
     
    9494    var time = new Date(); 
    9595    _config.fixture = document.getElementById('main').innerHTML; 
    96     _config.ajaxSettings = $.ajaxSettings; 
     96    _config.ajaxSettings = jQuery.ajaxSettings; 
    9797    synchronize(function() { 
    9898        time = new Date() - time; 
    99         $("<div>").html(['<p class="result">Tests completed in ', 
     99        jQuery("<div>").html(['<p class="result">Tests completed in ', 
    100100            time, ' milliseconds.<br/>', 
    101101            _config.stats.bad, ' tests of ', _config.stats.all, ' failed.</p>'] 
    102102            .join('')) 
    103103            .appendTo("body"); 
    104         $("#banner").addClass(_config.stats.bad ? "fail" : "pass"); 
     104        jQuery("#banner").addClass(_config.stats.bad ? "fail" : "pass"); 
    105105    }); 
    106106} 
     
    152152            var li = document.createElement("li"); 
    153153            li.className = _config.Test[i][0] ? "pass" : "fail"; 
    154             li.innerHTML = _config.Test[i][1]; 
     154            li.appendChild( document.createTextNode(_config.Test[i][1]) ); 
    155155            ol.appendChild( li ); 
    156156             
     
    175175                n.style.display = "none"; 
    176176        }; 
    177         $(b).dblclick(function(event) { 
     177        jQuery(b).dblclick(function(event) { 
    178178            var target = jQuery(event.target).filter("strong").clone(); 
    179179            if ( target.length ) { 
    180180                target.children().remove(); 
    181                 location.href = location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent($.trim(target.text())); 
     181                location.href = location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent(jQuery.trim(target.text())); 
    182182            } 
    183183        }); 
     
    205205 */ 
    206206function reset() { 
    207     $("#main").html( _config.fixture ); 
    208     $.event.global = {}; 
    209     $.ajaxSettings = $.extend({}, _config.ajaxSettings); 
     207    jQuery("#main").html( _config.fixture ); 
     208    jQuery.event.global = {}; 
     209    jQuery.ajaxSettings = jQuery.extend({}, _config.ajaxSettings); 
    210210} 
    211211 
    212212/** 
    213213 * Asserts true. 
    214  * @example ok( $("a").size() > 5, "There must be at least 5 anchors" ); 
     214 * @example ok( jQuery("a").size() > 5, "There must be at least 5 anchors" ); 
    215215 */ 
    216216function ok(a, msg) {