MCPcopy Index your code
hub / github.com/ampproject/amphtml / cleanupTestPageElements

Function cleanupTestPageElements

testing/init-tests-helpers.js:180–192  ·  view source on GitHub ↗

* Cleans up any HTML elements that tests might have added to the document.

()

Source from the content-addressed store, hash-verified

178 * Cleans up any HTML elements that tests might have added to the document.
179 */
180function cleanupTestPageElements() {
181 const cleanupTagNames = ['link', 'meta', 'iframe'];
182 const cleanup = document.querySelectorAll(cleanupTagNames.join(','));
183 for (let i = 0; i < cleanup.length; i++) {
184 try {
185 const element = cleanup[i];
186 removeElement(element);
187 } catch (e) {
188 // This sometimes fails for unknown reasons.
189 console./*OK*/ log(e);
190 }
191 }
192}

Callers 1

cleanupTestcaseFunction · 0.85

Calls 2

removeElementFunction · 0.90
logMethod · 0.45

Tested by

no test coverage detected