import { toBeDate } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/mod.ts";
Use .toBeDate
when checking if a value is a Date
import {
defineExpect,
not,
test,
toBeDate,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";
const expect = defineExpect({
matcherMap: {
toBeDate,
},
modifierMap: {
not,
},
});
test("passes when value is a date", () => {
expect(new Date("01/01/2018")).toBeDate();
expect("01/01/2018").not.toBeDate();
expect(undefined).not.toBeDate();
});