File tree Expand file tree Collapse file tree 2 files changed +23
-19
lines changed
8-show-liked-by-own-posts Expand file tree Collapse file tree 2 files changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -96,11 +96,13 @@ describe(`${postApiPath} routes`, () => {
9696 } ) ;
9797
9898 expect ( response . statusCode ) . toBe ( HttpCode . OK ) ;
99- expect ( response . json ( ) ) . toEqual ( [
100- expect . objectContaining ( {
101- userId : expect . not . stringContaining ( userId )
102- } )
103- ] ) ;
99+ expect ( response . json ( ) ) . toEqual (
100+ expect . arrayContaining ( [
101+ expect . objectContaining ( {
102+ userId : expect . not . stringContaining ( userId . toString ( ) )
103+ } )
104+ ] )
105+ ) ;
104106 } ) ;
105107
106108 it ( `should return ${ HttpCode . OK } with all users' posts` , async ( ) => {
@@ -114,14 +116,14 @@ describe(`${postApiPath} routes`, () => {
114116 } ) ;
115117
116118 expect ( response . statusCode ) . toBe ( HttpCode . OK ) ;
117- expect ( response . json ( ) ) . toEqual ( [
118- expect . objectContaining ( {
119- userId : expect . not . stringContaining ( userId )
120- } ) ,
121- expect . objectContaining ( {
122- userId
123- } )
124- ] ) ;
119+ expect ( response . json ( ) ) . toEqual (
120+ expect . arrayContaining ( [
121+ expect . objectContaining ( {
122+ userId : expect . not . stringContaining ( userId . toString ( ) )
123+ } ) ,
124+ expect . objectContaining ( { userId } )
125+ ] )
126+ ) ;
125127 } ) ;
126128 } ) ;
127129} ) ;
Original file line number Diff line number Diff line change @@ -111,12 +111,14 @@ describe(`${postApiPath} routes`, () => {
111111 } ) ;
112112
113113 expect ( response . statusCode ) . toBe ( HttpCode . OK ) ;
114- expect ( response . json ( ) ) . toEqual ( [
115- expect . objectContaining ( {
116- userId : expect . not . stringContaining ( userId )
117- } ) ,
118- expect . objectContaining ( { userId } )
119- ] ) ;
114+ expect ( response . json ( ) ) . toEqual (
115+ expect . arrayContaining ( [
116+ expect . objectContaining ( {
117+ userId : expect . not . stringContaining ( userId . toString ( ) )
118+ } ) ,
119+ expect . objectContaining ( { userId } )
120+ ] )
121+ ) ;
120122 } ) ;
121123 } ) ;
122124} ) ;
You can’t perform that action at this time.
0 commit comments