(label, haystack, terms)
| 584 | } |
| 585 | |
| 586 | function assertIncludesAll(label, haystack, terms) { |
| 587 | const normalizedTerms = terms.map((term) => normalizeComparableText(term)); |
| 588 | const matched = matchingTerms(normalizeComparableText(haystack), normalizedTerms); |
| 589 | if (matched.length !== normalizedTerms.length) { |
| 590 | const missing = terms.filter((term, index) => !matched.includes(normalizedTerms[index])); |
| 591 | throw new Error(`${label} is missing expected terms: ${missing.join(", ")}`); |
| 592 | } |
| 593 | } |
| 594 | |
| 595 | function hitText(hit) { |
| 596 | return [hit.title, hit.summary, hit.excerpt, hit.entity_name].filter(Boolean).join("\n"); |
nothing calls this directly
no test coverage detected