Skip to content

assertStringNotIncludes

Assert that a string does not include a given substring, with type narrowing.

import { assertStringNotIncludes } from "@kensio/smartass";
const message: string = "Upload success";
assertStringNotIncludes(message, "error");
// message is now narrowed to a string not including "error"

Source file: src/assert/string-not-includes/string-not-includes.assert.ts