Skip to main content
Module

x/unitest/mod.ts>toBeAfterOrEqualTo

🃏 Deno-first universal unit testing framework
Latest
function toBeAfterOrEqualTo
Re-export
import { toBeAfterOrEqualTo } from "https://deno.land/x/unitest@v1.0.0-beta.82/mod.ts";

Use .toBeAfterOrEqualTo when checking if a date equals to or occurs after date

import {
  defineExpect,
  not,
  test,
  toBeAfterOrEqualTo,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";

const expect = defineExpect({
  matcherMap: {
    toBeAfterOrEqualTo,
  },
  modifierMap: {
    not,
  },
});

test("passes when input is equal to or after date", () => {
  expect(new Date("01/01/2019")).toBeAfterOrEqualTo(new Date("01/01/2018"));
  expect(new Date("01/01/2019")).toBeAfterOrEqualTo(new Date("01/01/2019"));
  expect(new Date("01/01/2019")).not.toBeAfterOrEqualTo(new Date("01/01/2020"));
});

Parameters

actual: Date
expected: Date