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