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

x/unitest/matcher/to_be_integer.ts>toBeInteger

๐Ÿƒ Deno-first universal unit testing framework
Latest
function toBeInteger
import { toBeInteger } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/to_be_integer.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