Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/unitest/matcher/mod.ts>toEqualCaseInsensitive

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

Use .toEqualCaseInsensitive when checking if a string is equal to another ignoring the casing of both strings

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

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

test("passes when strings are equal ignoring case", () => {
  expect("hello world").toEqualCaseInsensitive("hello world");
  expect("hello world").toEqualCaseInsensitive("HELLO WORLD");
});

Parameters

actual: string
expected: string