File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
test/functional/unified-spec-runner Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -134,10 +134,14 @@ export function resultCheck(
134
134
135
135
if ( depth > 1 ) {
136
136
expect ( actual , `Expected actual to exist at ${ path . join ( '' ) } ` ) . to . exist ;
137
+ const actualKeys = Object . keys ( actual ) ;
138
+ const expectedKeys = Object . keys ( expected ) ;
139
+ // Don't check for full key set equality because some of the actual keys
140
+ // might be e.g. $$unsetOrMatches, which can be omitted.
137
141
expect (
138
- Object . keys ( actual ) ,
139
- `[${ Object . keys ( actual ) } ] length !== [${ Object . keys ( expected ) } ]`
140
- ) . to . have . lengthOf ( Object . keys ( expected ) . length ) ;
142
+ actualKeys . filter ( key => ! expectedKeys . includes ( key ) ) ,
143
+ `[${ Object . keys ( actual ) } ] has more than the expected keys: [${ Object . keys ( expected ) } ]`
144
+ ) . to . have . lengthOf ( 0 ) ;
141
145
}
142
146
143
147
for ( const [ key , value ] of expectedEntries ) {
You can’t perform that action at this time.
0 commit comments