File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 55 isErrorEvent ,
66 isInstanceOf ,
77 isNaN ,
8+ isPlainObject ,
89 isPrimitive ,
910 isThenable ,
1011 isVueViewModel ,
@@ -144,3 +145,27 @@ describe('isVueViewModel()', () => {
144145 expect ( isVueViewModel ( { foo : true } ) ) . toEqual ( false ) ;
145146 } ) ;
146147} ) ;
148+
149+ describe ( 'isPlainObject' , ( ) => {
150+ class MyClass {
151+ public foo : string = 'bar' ;
152+ }
153+
154+ it . each ( [
155+ [ { } , true ] ,
156+ [ true , false ] ,
157+ [ false , false ] ,
158+ [ undefined , false ] ,
159+ [ null , false ] ,
160+ [ '' , false ] ,
161+ [ 1 , false ] ,
162+ [ 0 , false ] ,
163+ [ { aha : 'yes' } , true ] ,
164+ [ new Object ( { aha : 'yes' } ) , true ] ,
165+ [ new String ( 'aa' ) , false ] ,
166+ [ new MyClass ( ) , true ] ,
167+ [ { ...new MyClass ( ) } , true ] ,
168+ ] ) ( '%s is %s' , ( value , expected ) => {
169+ expect ( isPlainObject ( value ) ) . toBe ( expected ) ;
170+ } ) ;
171+ } ) ;
You can’t perform that action at this time.
0 commit comments