import { toBeFinite } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/mod.ts";
Use .toBeFinite
when checking if a value is a number
, not NaN
or
Infinity
import {
defineExpect,
not,
test,
toBeFinite,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";
const expect = defineExpect({
matcherMap: {
toBeFinite,
},
modifierMap: {
not,
},
});
test("passes when value is a finite number", () => {
expect(1).toBeFinite();
expect(Infinity).not.toBeFinite();
expect(NaN).not.toBeFinite();
});