Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Poltergeist - turning off JQMIGRATE warnings

When running my test suite using poltergeist as the JavaScript driver, I am encountering the following warnings:

JQMIGRATE: jQuery.fn.attr(selected) may use property instead of attribute
JQMIGRATE: jQuery.browser is deprecated

Is that possible to turn them off?

like image 643
alexs333 Avatar asked Jul 23 '13 06:07

alexs333


3 Answers

Minified version is "muted" by default:

<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
like image 171
Ivan Chernykh Avatar answered Nov 08 '22 20:11

Ivan Chernykh


Look for jQuery.migrateMute = false in jquery-migrate.js and set it to true

like image 25
benchwarmer Avatar answered Nov 08 '22 21:11

benchwarmer


Following the answer from benchwarmer, this:

function custom_mute_jquery_migrator() {   
    echo '<script>jQuery.migrateMute = true;</script>';
}
add_action( 'wp_head', 'custom_mute_jquery_migrator' );
add_action( 'admin_head', 'custom_mute_jquery_migrator' );

Fixed it for me. Thanks @benchwarmer.

like image 4
user382738 Avatar answered Nov 08 '22 20:11

user382738