(callback)
| 81 | }); |
| 82 | |
| 83 | async function serverAct(callback) { |
| 84 | await callback(); |
| 85 | // Await one turn around the event loop. |
| 86 | // This assumes that we'll flush everything we have so far. |
| 87 | await new Promise(resolve => { |
| 88 | setImmediate(resolve); |
| 89 | }); |
| 90 | if (hasErrored) { |
| 91 | throw fatalError; |
| 92 | } |
| 93 | // JSDOM doesn't support stream HTML parser so we need to give it a proper fragment. |
| 94 | // We also want to execute any scripts that are embedded. |
| 95 | // We assume that we have now received a proper fragment of HTML. |
| 96 | const bufferedContent = buffer; |
| 97 | buffer = ''; |
| 98 | const temp = document.createElement('body'); |
| 99 | temp.innerHTML = bufferedContent; |
| 100 | await insertNodesAndExecuteScripts(temp, container, null); |
| 101 | jest.runAllTimers(); |
| 102 | } |
| 103 | |
| 104 | function Text(props) { |
| 105 | Scheduler.log(props.text); |
no test coverage detected