@@ -75,10 +75,18 @@ describe("ValidationStrategy", () => {
7575 } ) ;
7676
7777 describe ( "object" , ( ) => {
78- it ( "should not throw an error when the value is an object" , ( ) => {
78+ it ( "should not throw an error when the value is a plain object" , ( ) => {
7979 ValidationStrategy . object ( { } ) ;
8080 } ) ;
8181
82+ it ( "should not throw an error when the value is an array" , ( ) => {
83+ ValidationStrategy . object ( [ ] ) ;
84+ } ) ;
85+
86+ it ( "should not throw an error when the value is a non-plain object" , ( ) => {
87+ ValidationStrategy . object ( new Date ( ) ) ;
88+ } ) ;
89+
8290 it ( "should throw an error when the value is null" , ( ) => {
8391 assert . throws ( ( ) => {
8492 ValidationStrategy . object ( null ) ;
@@ -117,10 +125,18 @@ describe("ValidationStrategy", () => {
117125 } ) ;
118126
119127 describe ( "object?" , ( ) => {
120- it ( "should not throw an error when the value is an object" , ( ) => {
128+ it ( "should not throw an error when the value is a plain object" , ( ) => {
121129 ValidationStrategy [ "object?" ] ( { } ) ;
122130 } ) ;
123131
132+ it ( "should not throw an error when the value is an array" , ( ) => {
133+ ValidationStrategy [ "object?" ] ( [ ] ) ;
134+ } ) ;
135+
136+ it ( "should not throw an error when the value is a non-plain object" , ( ) => {
137+ ValidationStrategy [ "object?" ] ( new Date ( ) ) ;
138+ } ) ;
139+
124140 it ( "should not throw an error when the value is null" , ( ) => {
125141 ValidationStrategy [ "object?" ] ( null ) ;
126142 } ) ;
0 commit comments