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 11const { strictEqual } = require ( 'assert' ) ;
2+ const expect = require ( 'expect' ) ;
23const { logIf, parseEnvelope } = require ( './common' ) ;
34
45const VALID_REQUEST_PAYLOAD = {
@@ -105,8 +106,10 @@ const assertObjectMatches = (actual, expected) => {
105106 for ( const key in expected ) {
106107 const expectedValue = expected [ key ] ;
107108
108- if ( Object . prototype . toString . call ( expectedValue ) === '[object Object]' || Array . isArray ( expectedValue ) ) {
109+ if ( Object . prototype . toString . call ( expectedValue ) === '[object Object]' ) {
109110 assertObjectMatches ( actual [ key ] , expectedValue ) ;
111+ } else if ( Array . isArray ( expectedValue ) ) {
112+ expect ( actual [ key ] ) . toEqual ( expect . arrayContaining ( expectedValue . map ( expect . objectContaining ) ) ) ;
110113 } else {
111114 strictEqual ( actual [ key ] , expectedValue ) ;
112115 }
You can’t perform that action at this time.
0 commit comments