···5151 const resolvedLines: string[] = []
5252 let pass = true
53535454- for (const [key, actualValue] of Object.entries(captured)) {
5555- const expectedValue = expected[key]
5656-5757- // non asserted keys are skipped (works as subset match)
5858- if (typeof expectedValue === 'undefined') {
5959- continue;
5454+ // iterate on `expected` side so extra key on `actual` side
5555+ // is ignored and works as subset match
5656+ for (const [key, expectedValue] of Object.entries(expected)) {
5757+ const actualValue = captured[key]
5858+ if (actualValue === undefined) {
5959+ pass = false
6060+ continue
6061 }
61626263 // preserve matched pattern for normalized error diff and partial update