import { number } from "https://deno.land/x/unitest@v1.0.0-beta.82/modifier/mod.ts";
Use .number
to convert any actual
to number
. Internally, the Number
constructor is used.
import {
defineExpect,
number,
test,
toBe,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";
const expect = defineExpect({
matcherMap: {
toBe,
},
modifierMap: {
number,
},
});
test("passes when numberized value to be", () => {
expect("").number.toBe(0);
expect("test").number.toBe(NaN);
});
type
PreModifier<unknown, PreModifierResult<number>>