Skip to main content
Module

x/unitest/mod.ts>toBeInteger

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

Use .toBeInteger when checking if a number is an integer

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

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

test("passes when value is an integer", () => {
  expect(1).toBeInteger();
  expect(1.0).toBeInteger();
  expect(1.1).not.toBeInteger();
});

Parameters

actual: unknown