Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
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

Returns

MatchResult