MCPcopy
hub / github.com/freshframework/fresh / assertMetaContent

Function assertMetaContent

packages/fresh/tests/test_utils.tsx:270–293  ·  view source on GitHub ↗
(
  doc: Document,
  nameOrProperty: string,
  expected: string,
)

Source from the content-addressed store, hash-verified

268}
269
270export function assertMetaContent(
271 doc: Document,
272 nameOrProperty: string,
273 expected: string,
274) {
275 let el = doc.querySelector(`meta[name="${nameOrProperty}"]`) as
276 | HTMLMetaElement
277 | null;
278
279 if (el === null) {
280 el = doc.querySelector(`meta[property="${nameOrProperty}"]`) as
281 | HTMLMetaElement
282 | null;
283 }
284
285 if (el === null) {
286 // deno-lint-ignore no-console
287 console.log(prettyDom(doc));
288 throw new Error(
289 `No <meta>-tag found with content "${expected}"`,
290 );
291 }
292 expect(el.content).toEqual(expected);
293}
294
295export async function waitForText(
296 page: Page,

Callers 1

partials_test.tsxFile · 0.90

Calls 1

prettyDomFunction · 0.85

Tested by

no test coverage detected