From: Oleg Gaidarenko Date: Tue, 8 Sep 2015 01:02:51 +0000 (+0300) Subject: Tests: more style corrections X-Git-Tag: 1.12.0~131 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d8b7e7b0bd047f02890de2874cafdd3e0f8dd608;p=jquery.git Tests: more style corrections Provocated by jscs-dev/node-jscs@2de68c0 Ref c161eecce09fc66ce252d4adf64b565f726bb6d2 --- diff --git a/test/unit/ajax.js b/test/unit/ajax.js index edeed18fc..4d9b1bc49 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -792,7 +792,7 @@ QUnit.module( "ajax", { ); } - jQuery.ajax({ + jQuery.ajax( { url: "data/jsonp.php", dataType: "jsonp", crossDomain: crossDomain, @@ -800,7 +800,7 @@ QUnit.module( "ajax", { assert.strictEqual( this.jsonpCallback, previous.callback, "JSONP callback name is re-used" ); return false; } - }); + } ); } }; } ); @@ -1549,7 +1549,7 @@ QUnit.module( "ajax", { assert.ok( false, "error" ); } }; - }); + } ); } ajaxTest( "#14683 - jQuery.ajax() - Exceptions thrown synchronously by xhr.send should be caught", 4, function( assert ) { @@ -1582,8 +1582,6 @@ QUnit.module( "ajax", { } ); - - // //----------- jQuery.ajaxPrefilter() ajaxTest( "jQuery.ajaxPrefilter() - abort", 1, function( assert ) { diff --git a/test/unit/core.js b/test/unit/core.js index de0fc0bcd..e466dad8d 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -1373,7 +1373,7 @@ QUnit.test( "jQuery.parseHTML", function( assert ) { if ( jQuery.support.createHTMLDocument ) { QUnit.asyncTest( "jQuery.parseHTML", function( assert ) { - assert.expect ( 1 ); + assert.expect( 1 ); Globals.register( "parseHTMLError" ); diff --git a/test/unit/data.js b/test/unit/data.js index 5a232c401..20d7c27d0 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -535,8 +535,8 @@ QUnit.test( "data-* attributes", function( assert ) { child.data( "notjson" ), " {}", "JSON object with leading non-JSON read from attribute as string" ); assert.strictEqual( - child.data("notjson2"), "[] ", - "JSON array with trailing non-JSON read from attribute as string"); + child.data( "notjson2" ), "[] ", + "JSON array with trailing non-JSON read from attribute as string" ); assert.strictEqual( child.data( "empty" ), "", "Empty string read from attribute" ); @@ -1128,8 +1128,9 @@ QUnit.test( ".data(prop) does not create expando", function( assert ) { var key, div = jQuery( "
" ); - div.data("foo"); - assert.equal( false, jQuery.hasData( div[0] ) ); + div.data( "foo" ); + assert.equal( false, jQuery.hasData( div[ 0 ] ) ); + // Make sure no expando has been added for ( key in div[ 0 ] ) { if ( /^jQuery/.test( key ) ) { diff --git a/test/unit/effects.js b/test/unit/effects.js index f290eec63..e3dc0e462 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -1849,7 +1849,7 @@ QUnit.test( "non-px animation handles non-numeric start (#11971)", function( ass this.clock.tick( 10 ); } ); -QUnit.test("Animation callbacks (#11797)", function( assert ) { +QUnit.test( "Animation callbacks (#11797)", function( assert ) { assert.expect( 16 ); var prog = 0, @@ -1970,7 +1970,7 @@ QUnit.test( "Animation callbacks in order (#2292)", function( assert ) { always: function() { assert.step( 5 ); } - }).finish(); + } ).finish(); this.clock.tick( dur + 10 ); } ); diff --git a/test/unit/event.js b/test/unit/event.js index cb4fb629b..0f500e6cd 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -2515,7 +2515,7 @@ testIframeWithCallback( var input = jQuery( frameDoc ).find( "#frame-input" ); // Create a focusin handler on the parent; shouldn't affect the iframe's fate - jQuery ( "body" ).on( "focusin.iframeTest", function() { + jQuery( "body" ).on( "focusin.iframeTest", function() { assert.ok( false, "fired a focusin event in the parent document" ); } ); diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index dad61a476..a3da639c6 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -99,11 +99,11 @@ function testText( valueObj, assert ) { } QUnit.test( "text(String)", function( assert ) { - testText(manipulationBareObj, assert ); + testText( manipulationBareObj, assert ); } ); QUnit.test( "text(Function)", function( assert ) { - testText(manipulationFunctionReturningObj, assert ); + testText( manipulationFunctionReturningObj, assert ); } ); QUnit.test( "text(Function) with incoming value", function( assert ) { @@ -198,8 +198,8 @@ function testAppend( valueObj, assert ) { assert.expect( 78 ); - testAppendForObject( valueObj,false, assert ); - testAppendForObject( valueObj,true, assert ); + testAppendForObject( valueObj, false, assert ); + testAppendForObject( valueObj, true, assert ); var defaultText, result, message, iframe, iframeDoc, j, d, $input, $radioChecked, $radioUnchecked, $radioParent, $map, $table; @@ -306,11 +306,11 @@ function testAppend( valueObj, assert ) { } QUnit.test( "append(String|Element|Array|jQuery)", function( assert ) { - testAppend(manipulationBareObj, assert ); + testAppend( manipulationBareObj, assert ); } ); QUnit.test( "append(Function)", function( assert ) { - testAppend(manipulationFunctionReturningObj, assert ); + testAppend( manipulationFunctionReturningObj, assert ); } ); QUnit.test( "append(param) to object, see #11280", function( assert ) {