Skip to main content
Module

x/unitest/mod.ts>objectContaining

🃏 Deno-first universal unit testing framework
Latest
function objectContaining
import { objectContaining } from "https://deno.land/x/unitest@v1.0.0-beta.82/mod.ts";

matches any received object that recursively matches the expected properties

import {
  any,
  expect,
  objectContaining,
  test,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";

test("should be any number", () => {
  expect({
    name: "Bob",
    score: 100,
  }).toEqual({
    name: any(String),
    score: any(Number),
  });
});

Parameters

object: Record<PropertyKey, unknown>

Returns

ObjectContaining