Skip to main content
Module

x/unitest/mod.ts>toBeNegative

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

Use .toBeNegative when checking if a value is a negative number

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

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

test("passes when value is a negative number", () => {
  expect(-1).toBeNegative();
  expect(-Infinity).not.toBeNegative();
  expect(1).not.toBeNegative();
  expect(NaN).not.toBeNegative();
});

Parameters

actual: number