MCPcopy Create free account
hub / github.com/denoland/std / assertStringIncludes

Function assertStringIncludes

assert/string_includes.ts:21–30  ·  view source on GitHub ↗
(
  actual: string,
  expected: string,
  msg?: string,
)

Source from the content-addressed store, hash-verified

19 * @param msg The optional message to display if the assertion fails.
20 */
21export function assertStringIncludes(
22 actual: string,
23 expected: string,
24 msg?: string,
25) {
26 if (actual.includes(expected)) return;
27 const msgSuffix = msg ? `: ${msg}` : ".";
28 msg = `Expected actual: "${actual}" to contain: "${expected}"${msgSuffix}`;
29 throw new AssertionError(msg);
30}

Callers 9

pool_test.tsFile · 0.90
snapshot_test.tsFile · 0.90
empty_dir_test.tsFile · 0.90
exists_test.tsFile · 0.90
fnFunction · 0.90

Calls 1

includesMethod · 0.80

Tested by

no test coverage detected