MCPcopy Create free account
hub / github.com/github/gh-aw / assertContains

Function assertContains

scripts/changeset.test.js:29–38  ·  view source on GitHub ↗

* Test helper to check if content contains expected string

(content, expected, testName)

Source from the content-addressed store, hash-verified

27 * Test helper to check if content contains expected string
28 */
29function assertContains(content, expected, testName) {
30 if (!content.includes(expected)) {
31 console.error(`❌ FAIL: ${testName}`);
32 console.error(` Expected to find: "${expected}"`);
33 console.error(` In content: ${content.substring(0, 200)}...`);
34 return false;
35 }
36 console.log(`✓ PASS: ${testName}`);
37 return true;
38}
39
40/**
41 * Test helper to check if content does NOT contain unexpected string

Callers 2

runTestsFunction · 0.70

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected