mirror of
https://github.com/jquery/jquery.git
synced 2024-10-05 11:34:18 +00:00
Tests: add additional test for jQuery.isPlainObject
Ref 00575d4d8c
Also see discussion in
https://github.com/jquery/jquery/pull/2970#discussion_r54970557
This commit is contained in:
parent
59ec78e602
commit
728ea2f277
@ -365,7 +365,6 @@ QUnit.asyncTest( "isPlainObject", function( assert ) {
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
//
|
|
||||||
QUnit[ typeof Symbol === "function" ? "test" : "skip" ]( "isPlainObject(Symbol)", function( assert ) {
|
QUnit[ typeof Symbol === "function" ? "test" : "skip" ]( "isPlainObject(Symbol)", function( assert ) {
|
||||||
assert.expect( 2 );
|
assert.expect( 2 );
|
||||||
|
|
||||||
@ -373,6 +372,17 @@ QUnit[ typeof Symbol === "function" ? "test" : "skip" ]( "isPlainObject(Symbol)"
|
|||||||
assert.equal( jQuery.isPlainObject( Object( Symbol() ) ), false, "Symbol inside an object" );
|
assert.equal( jQuery.isPlainObject( Object( Symbol() ) ), false, "Symbol inside an object" );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
QUnit[ "assign" in Object ? "test" : "skip" ]( "isPlainObject(Object.assign(...))",
|
||||||
|
function( assert ) {
|
||||||
|
assert.expect( 1 );
|
||||||
|
|
||||||
|
var parentObj = { foo: "bar" };
|
||||||
|
var childObj = Object.assign( Object.create( parentObj ), { bar: "foo" } );
|
||||||
|
|
||||||
|
assert.ok( !jQuery.isPlainObject( childObj ), "isPlainObject(Object.assign(...))" );
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
QUnit.test( "isFunction", function( assert ) {
|
QUnit.test( "isFunction", function( assert ) {
|
||||||
assert.expect( 19 );
|
assert.expect( 19 );
|
||||||
|
Loading…
Reference in New Issue
Block a user