MCPcopy Create free account
hub / github.com/denoland/std / assertObjectMatch

Function assertObjectMatch

assert/object_match.ts:32–47  ·  view source on GitHub ↗
(
  // deno-lint-ignore no-explicit-any
  actual: Record<PropertyKey, any>,
  expected: Record<PropertyKey, unknown>,
  msg?: string,
)

Source from the content-addressed store, hash-verified

30 * @param msg The optional message to display if the assertion fails.
31 */
32export 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
49type Loose = Record<PropertyKey, unknown>;
50

Callers 7

bdd_test.tsFile · 0.90
assertOptionsFunction · 0.90
assertIgnoreOptionsFunction · 0.90
assertOnlyFunction · 0.90
assertDescribeOptionsFunction · 0.90
assertItOptionsFunction · 0.90

Calls 2

assertEqualsFunction · 0.90
filterFunction · 0.85

Tested by

no test coverage detected