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