* Resets the window's testing state. Used at the start by initializeTests() and * before each test case by setupTestcase().
()
| 143 | * before each test case by setupTestcase(). |
| 144 | */ |
| 145 | function 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. |
no test coverage detected