MCPcopy
hub / github.com/bubkoo/html-to-image / assertTextRendered

Function assertTextRendered

test/spec/helper.ts:169–176  ·  view source on GitHub ↗
(lines: string[], options?: Options)

Source from the content-addressed store, hash-verified

167const PASS_TEXT_MATCH = true
168
169export function assertTextRendered(lines: string[], options?: Options) {
170 return (node: HTMLDivElement = getCaptureNode()) =>
171 PASS_TEXT_MATCH
172 ? expect(true).toBe(true)
173 : recognizeImage(node, options).then((text) => {
174 expect(lines.every((line) => text.includes(line))).toBe(true)
175 })
176}
177
178export async function recognizeImage(node: HTMLDivElement, options?: Options) {
179 return toPng(node, options)

Callers 3

special.spec.tsFile · 0.90
basic.spec.tsFile · 0.90
options.spec.tsFile · 0.90

Calls 2

getCaptureNodeFunction · 0.85
recognizeImageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…