aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/wrap.js
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2013-04-09 11:45:09 -0400
committerTimmy Willison <timmywillisn@gmail.com>2013-04-09 11:59:31 -0400
commit0fa52c11cbfe70780648b99717f1dd3502befaff (patch)
tree9cd6bfc3b17ae21385aeebd32205d7281934fa17 /test/unit/wrap.js
parent0afc92bd73a61a0279a419647458e6ed89638ae0 (diff)
downloadjquery-0fa52c11cbfe70780648b99717f1dd3502befaff.tar.gz
jquery-0fa52c11cbfe70780648b99717f1dd3502befaff.zip
Update jshintrc to conform to new style guide. Conform to onevar and unused in tests. Fixes #13755.
Diffstat (limited to 'test/unit/wrap.js')
-rw-r--r--test/unit/wrap.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/unit/wrap.js b/test/unit/wrap.js
index 1775aafb6..3de1c7931 100644
--- a/test/unit/wrap.js
+++ b/test/unit/wrap.js
@@ -9,17 +9,17 @@ module( "wrap", {
});
// See test/unit/manipulation.js for explanation about these 2 functions
-var manipulationBareObj = function( value ) {
+function manipulationBareObj( value ) {
return value;
-};
+}
-var manipulationFunctionReturningObj = function( value ) {
- return (function() {
+function manipulationFunctionReturningObj( value ) {
+ return function() {
return value;
- });
-};
+ };
+}
-var testWrap = function( val ) {
+function testWrap( val ) {
expect( 19 );
@@ -99,7 +99,7 @@ var testWrap = function( val ) {
// clean up attached elements
QUnit.reset();
-};
+}
test( "wrap(String|Element)", function() {
testWrap( manipulationBareObj );
@@ -136,7 +136,7 @@ test( "wrap(String) consecutive elements (#10177)", function() {
});
});
-var testWrapAll = function( val ) {
+function testWrapAll( val ) {
expect( 8 );
@@ -160,17 +160,18 @@ var testWrapAll = function( val ) {
equal( jQuery("#first").parent()[ 0 ], jQuery("#firstp").parent()[ 0 ], "Same Parent" );
equal( jQuery("#first").parent()[ 0 ].previousSibling, prev, "Correct Previous Sibling" );
equal( jQuery("#first").parent()[ 0 ].parentNode, p, "Correct Parent" );
-};
+}
test( "wrapAll(String|Element)", function() {
testWrapAll( manipulationBareObj );
});
-var testWrapInner = function( val ) {
+function testWrapInner( val ) {
expect( 11 );
- var num;
+ var num,
+ div = jQuery("<div/>");
num = jQuery("#first").children().length;
jQuery("#first").wrapInner( val("<div class='red'><div id='tmp'></div></div>") );
@@ -193,11 +194,10 @@ var testWrapInner = function( val ) {
ok( jQuery("#first").children().is("#empty"), "Verify Right Element" );
equal( jQuery("#first").children().children().length, num, "Verify Elements Intact" );
- var div = jQuery("<div/>");
div.wrapInner( val("<span></span>") );
equal( div.children().length, 1, "The contents were wrapped." );
equal( div.children()[ 0 ].nodeName.toLowerCase(), "span", "A span was inserted." );
-};
+}
test( "wrapInner(String|Element)", function() {
testWrapInner( manipulationBareObj );