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