Skip to main content
Module

x/unitest/mod.ts>toBeEmptyObject

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

Use .toBeEmptyObject when checking if a value is an empty Object

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

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

test("passes when value is an empty object", () => {
  expect({}).toBeEmptyObject();
  expect([]).toBeEmptyObject();
  expect({ a: "hello" }).not.toBeEmptyObject();
});

Parameters

actual: object