( // deno-lint-ignore no-explicit-any actual: Record<PropertyKey, any>, expected: Record<PropertyKey, unknown>, msg?: string, )
| 30 | * @param msg The optional message to display if the assertion fails. |
| 31 | */ |
| 32 | export function assertObjectMatch( |
| 33 | // deno-lint-ignore no-explicit-any |
| 34 | actual: Record<PropertyKey, any>, |
| 35 | expected: Record<PropertyKey, unknown>, |
| 36 | msg?: string, |
| 37 | ): void { |
| 38 | return assertEquals( |
| 39 | // get the intersection of "actual" and "expected" |
| 40 | // side effect: all the instances' constructor field is "Object" now. |
| 41 | filter(actual, expected), |
| 42 | // set (nested) instances' constructor field to be "Object" without changing expected value. |
| 43 | // see https://github.com/denoland/std/pull/1419 |
| 44 | filter(expected, expected), |
| 45 | msg, |
| 46 | ); |
| 47 | } |
| 48 | |
| 49 | type Loose = Record<PropertyKey, unknown>; |
| 50 |
no test coverage detected