aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2016-03-14 16:46:51 -0400
committerTimmy Willison <timmywillisn@gmail.com>2016-04-04 12:02:13 -0400
commite0d3bfa77073a245ca112736a1ed3db07d5adcf6 (patch)
tree4226878c88c40068e2eea1659339ada15965979c /test/unit
parent10fc59007d717432ea126e49ce4142e6c4d5136e (diff)
downloadjquery-e0d3bfa77073a245ca112736a1ed3db07d5adcf6.tar.gz
jquery-e0d3bfa77073a245ca112736a1ed3db07d5adcf6.zip
Core: Simplify isPlainObject
Fixes gh-2986 Close gh-2998
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/core.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 5bf3ab1d1..f18ad2e82 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -287,7 +287,7 @@ QUnit.test( "type for `Symbol`", function( assert ) {
QUnit.asyncTest( "isPlainObject", function( assert ) {
- assert.expect( 22 );
+ assert.expect( 23 );
var pass, iframe, doc, parentObj, childObj, deep,
fn = function() {};
@@ -300,12 +300,13 @@ QUnit.asyncTest( "isPlainObject", function( assert ) {
assert.ok( jQuery.isPlainObject( { constructor: "foo" } ),
"plain object with primitive constructor property" );
- parentObj = { foo: "bar" };
+ parentObj = {};
childObj = Object.create( parentObj );
-
- assert.ok( !jQuery.isPlainObject( childObj ), "isPlainObject(Object.create({}))" );
+ assert.ok( !jQuery.isPlainObject( childObj ), "Object.create({})" );
+ parentObj.foo = "bar";
+ assert.ok( !jQuery.isPlainObject( childObj ), "Object.create({...})" );
childObj.bar = "foo";
- assert.ok( !jQuery.isPlainObject( childObj ), "isPlainObject(Object.create({}))" );
+ assert.ok( !jQuery.isPlainObject( childObj ), "extend(Object.create({...}), ...)" );
// Not objects shouldn't be matched
assert.ok( !jQuery.isPlainObject( "" ), "string" );