File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -166,9 +166,12 @@ export class ModelSteps extends BaseModelStep {
166166 @then ( / t h e r e s p o n s e s h o u l d h a v e a p r o p e r t y ( [ a - z A - Z ] * ) w i t h v a l u e ( .* ) / )
167167 public checkResponseProperty ( propName : string , propValue : string ) {
168168 const value = this . apiResponse . data [ propName ] ;
169- const formattedValue =
170- value instanceof Date ? value . toISOString ( ) : value . toString ( ) ;
171- assert . equal ( formattedValue , propValue ) ;
169+ if ( value instanceof Date ) {
170+ // JS/TS does not differentiate date/date-time. Need to construct prop date and compare.
171+ assert . equal ( value . toISOString ( ) , new Date ( propValue ) . toISOString ( ) ) ;
172+ } else {
173+ assert . equal ( value . toString ( ) , propValue ) ;
174+ }
172175 }
173176
174177 @then ( / t h e r e s p o n s e s h o u l d b e a n a r r a y / )
You can’t perform that action at this time.
0 commit comments