Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/unitest/matcher/mod.ts>toEndWith

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

Use .toEndWith when checking if a string ends with a given string suffix

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

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

test("passes when value is ends with given string", () => {
  expect("hello world").toEndWith("world");
  expect("hello world").not.toEndWith("hello");
});

Parameters

actual: string
suffix: string