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

x/unitest/matcher/to_be_frozen.ts>toBeFrozen

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

Use .toBeFrozen when checking if an object is frozen

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

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

test("passes when value is frozen", () => {
  expect(Object.freeze({})).toBeFrozen();
  expect(1).toBeFrozen();
  expect({}).not.toBeFrozen();
});

Parameters

actual: unknown