aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2015-12-22 17:52:22 +0300
committerOleg Gaidarenko <markelog@gmail.com>2015-12-22 17:52:22 +0300
commitfd5858f5423968aed8329f2cc0e5e590a7e05621 (patch)
treed66a17be50822a511d2ea5d59874922e0f21c3b7 /test
parent9f2dcb93f848a698602cb7cde1128e7e6907d9cc (diff)
downloadjquery-fd5858f5423968aed8329f2cc0e5e590a7e05621.tar.gz
jquery-fd5858f5423968aed8329f2cc0e5e590a7e05621.zip
Revert "Core: Throw an error on $("#") rather than returning 0-length collection"
This reverts commit 93f95c966355f02b5695f50523f88687eadb4c81.
Diffstat (limited to 'test')
-rw-r--r--test/unit/core.js17
1 files changed, 5 insertions, 12 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 472c4b5af..f2d6fbf51 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -56,18 +56,11 @@ QUnit.test( "jQuery()", function( assert ) {
assert.expect( expected );
// Basic constructor's behavior
- assert.equal( jQuery().length, 0, "jQuery() === jQuery([])" );
- assert.equal( jQuery( undefined ).length, 0, "jQuery(undefined) === jQuery([])" );
- assert.equal( jQuery( null ).length, 0, "jQuery(null) === jQuery([])" );
- assert.equal( jQuery( "" ).length, 0, "jQuery('') === jQuery([])" );
- assert.deepEqual( jQuery( obj ).get(), obj.get(), "jQuery(jQueryObj) == jQueryObj" );
-
- // Invalid #id goes to Sizzle which will throw an error (gh-1682)
- try {
- jQuery( "#" );
- } catch ( e ) {
- assert.ok( true, "Threw an error on #id with no id" );
- }
+ equal( jQuery().length, 0, "jQuery() === jQuery([])" );
+ equal( jQuery(undefined).length, 0, "jQuery(undefined) === jQuery([])" );
+ equal( jQuery(null).length, 0, "jQuery(null) === jQuery([])" );
+ equal( jQuery("").length, 0, "jQuery('') === jQuery([])" );
+ equal( jQuery("#").length, 0, "jQuery('#') === jQuery([])" );
// can actually yield more than one, when iframes are included, the window is an array as well
assert.equal( jQuery( window ).length, 1, "Correct number of elements generated for jQuery(window)" );