MCPcopy
hub / github.com/angular/angular / expectHTML

Function expectHTML

packages/core/test/acceptance/hmr_spec.ts:2403–2410  ·  view source on GitHub ↗
(element: HTMLElement, expectation: string)

Source from the content-addressed store, hash-verified

2401 }
2402
2403 function expectHTML(element: HTMLElement, expectation: string) {
2404 const actual = element.innerHTML
2405 .replace(/<!--(\W|\w)*?-->/g, '')
2406 .replace(/\s(ng-reflect|_nghost|_ngcontent)-\S*="[^"]*"/g, '');
2407 expect(actual.replace(/\s/g, '') === expectation.replace(/\s/g, ''))
2408 .withContext(`HTML does not match expectation. Actual HTML:\n${actual}`)
2409 .toBe(true);
2410 }
2411
2412 function setMarker(node: Node) {
2413 (node as any)[CREATED_INITIALLY_MARKER] = true;

Callers 1

hmr_spec.tsFile · 0.85

Calls 2

withContextMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…