MCPcopy
hub / github.com/ampproject/amphtml / resetTestingState

Function resetTestingState

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

* Resets the window's testing state. Used at the start by initializeTests() and * before each test case by setupTestcase().

()

Source from the content-addressed store, hash-verified

143 * before each test case by setupTestcase().
144 */
145function resetTestingState() {
146 activateChunkingForTesting();
147 resetWindowState();
148 installDocService(window, /* isSingleDoc */ true);
149 const ampdoc = Services.ampdocServiceFor(window).getSingleDoc();
150 installRuntimeServices(window);
151 installAmpdocServices(ampdoc);
152 Services.resourcesForDoc(ampdoc).ampInitComplete();
153 adoptWithMultidocDeps(window);
154 configureEnzyme({adapter: new PreactEnzyme()});
155}
156
157/**
158 * Cleans up global state added during tests.

Callers 2

initializeTestsFunction · 0.85
setupTestcaseFunction · 0.85

Calls 8

installDocServiceFunction · 0.90
installRuntimeServicesFunction · 0.90
installAmpdocServicesFunction · 0.90
adoptWithMultidocDepsFunction · 0.90
resetWindowStateFunction · 0.85
getSingleDocMethod · 0.80
ampInitCompleteMethod · 0.45

Tested by

no test coverage detected