File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/nextjs/test/integration/test/utils Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
const { strictEqual } = require ( 'assert' ) ;
2
+ const expect = require ( 'expect' ) ;
2
3
const { logIf, parseEnvelope } = require ( './common' ) ;
3
4
4
5
const VALID_REQUEST_PAYLOAD = {
@@ -105,8 +106,10 @@ const assertObjectMatches = (actual, expected) => {
105
106
for ( const key in expected ) {
106
107
const expectedValue = expected [ key ] ;
107
108
108
- if ( Object . prototype . toString . call ( expectedValue ) === '[object Object]' || Array . isArray ( expectedValue ) ) {
109
+ if ( Object . prototype . toString . call ( expectedValue ) === '[object Object]' ) {
109
110
assertObjectMatches ( actual [ key ] , expectedValue ) ;
111
+ } else if ( Array . isArray ( expectedValue ) ) {
112
+ expect ( actual [ key ] ) . toEqual ( expect . arrayContaining ( expectedValue . map ( expect . objectContaining ) ) ) ;
110
113
} else {
111
114
strictEqual ( actual [ key ] , expectedValue ) ;
112
115
}
You can’t perform that action at this time.
0 commit comments