diff --git a/src/migrate.js b/src/migrate.js index 0c391f7d..b2686987 100644 --- a/src/migrate.js +++ b/src/migrate.js @@ -31,6 +31,7 @@ var warnedAbout = {}; // List of warnings already given; public read only jQuery.migrateWarnings = []; +jQuery.migrateWarnings.asErrors = []; // Set to false to disable traces that appear with warnings if ( jQuery.migrateTrace === undefined ) { @@ -40,7 +41,7 @@ if ( jQuery.migrateTrace === undefined ) { // Forget any warnings we've already given; public jQuery.migrateReset = function() { warnedAbout = {}; - jQuery.migrateWarnings.length = 0; + jQuery.migrateWarnings.length = jQuery.migrateWarnings.asErrors.length = 0; }; function migrateWarn( msg ) { @@ -48,12 +49,14 @@ function migrateWarn( msg ) { if ( !warnedAbout[ msg ] ) { warnedAbout[ msg ] = true; jQuery.migrateWarnings.push( msg ); + jQuery.migrateWarnings.asErrors.push( new Error( msg ) ); if ( console && console.warn && !jQuery.migrateMute ) { console.warn( "JQMIGRATE: " + msg ); if ( jQuery.migrateTrace && console.trace ) { console.trace(); } } + jQuery( window ).trigger( "migrateWarning" ); } } diff --git a/test/ajax.js b/test/ajax.js index 81b1ed09..12712e91 100644 --- a/test/ajax.js +++ b/test/ajax.js @@ -1,7 +1,7 @@ module( "ajax" ); test( "jQuery.ajax() deprecations on jqXHR", function( assert ) { - assert.expect( 3 ); + assert.expect( 4 ); var done = assert.async(); diff --git a/test/attributes.js b/test/attributes.js index 90810f22..d8562bb3 100644 --- a/test/attributes.js +++ b/test/attributes.js @@ -2,7 +2,7 @@ QUnit.module( "attributes" ); QUnit.test( ".removeAttr( boolean attribute )", function( assert ) { - assert.expect( 8 ); + assert.expect( 9 ); expectNoWarning( "non-boolean attr", function() { var $div = jQuery( "
" ) @@ -43,7 +43,7 @@ QUnit.test( ".removeAttr( boolean attribute )", function( assert ) { } ); QUnit.test( ".toggleClass( boolean )", function( assert ) { - assert.expect( 14 ); + assert.expect( 17 ); var e = jQuery( "" ).appendTo( "#qunit-fixture" ); diff --git a/test/core.js b/test/core.js index a0fec314..646b5deb 100644 --- a/test/core.js +++ b/test/core.js @@ -28,7 +28,7 @@ test( "jQuery( '#' )", function() { } ); QUnit.test( "Attribute selectors with unquoted hashes", function( assert ) { - expect( 31 ); + expect( 34 ); var markup = jQuery( "