Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/unitest/matcher/to_be_object.ts>toBeObject

๐Ÿƒ Deno-first universal unit testing framework
Latest
function toBeObject
import { toBeObject } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/to_be_object.ts";

Use .toBeObject when checking if a value is an Object

import {
  defineExpect,
  not,
  test,
  toBeObject,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";

const expect = defineExpect({
  matcherMap: {
    toBeObject,
  },
  modifierMap: {
    not,
  },
});

test("passes when value is an object", () => {
  expect({}).toBeObject();
  expect({ a: "hello" }).toBeObject();
  expect(true).not.toBeObject();
});

Parameters

actual: unknown