assertStringIncludes

import { assertStringIncludes } from "jsr:@ende/assert";

function

function assertStringIncludes(actual: string, expected: string, msg?: string): void

Make an assertion that actual includes expected. If not then throw.

actual: string

The actual string to check for inclusion.

expected: string

The expected string to check for inclusion.

msg?: string

The optional message to display if the assertion fails.

Example: Usage

import { assertStringIncludes } from "@ende/assert";

assertStringIncludes("Hello", "ello"); // Doesn't throw
assertStringIncludes("Hello", "world"); // Throws

Source