Skip to main content
Module

x/unitest/mod.ts>toBeAnything

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

Use .toBeAnything when checking if a value is not null and undefined.

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

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

test("passes when value is not null", () => {
  expect(0).toBeAnything();
  expect(null).not.toBeAnything();
  expect(undefined).not.toBeAnything();
});

Parameters

actual: unknown