File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
react-server-dom-webpack/src/__tests__ Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ global.ReadableStream =
1515global . TextEncoder = require ( 'util' ) . TextEncoder ;
1616global . TextDecoder = require ( 'util' ) . TextDecoder ;
1717
18+ // Don't wait before processing work on the server.
19+ // TODO: we can replace this with FlightServer.act().
20+ global . setTimeout = cb => cb ( ) ;
21+
1822let clientExports ;
1923let webpackMap ;
2024let webpackModules ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export type PrecomputedChunk = Uint8Array;
1313export opaque type Chunk = Uint8Array ;
1414
1515export function scheduleWork ( callback : ( ) = > void ) {
16- callback ( ) ;
16+ setTimeout ( callback , 0 ) ;
1717}
1818
1919export function flushBuffered ( destination : Destination ) {
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ global.Response = require('node-fetch').Response;
2020// Patch for Edge environments for global scope
2121global . AsyncLocalStorage = require ( 'async_hooks' ) . AsyncLocalStorage ;
2222
23+ // Don't wait before processing work on the server.
24+ // TODO: we can replace this with FlightServer.act().
25+ global . setTimeout = cb => cb ( ) ;
26+
2327let fetchCount = 0 ;
2428async function fetchMock ( resource , options ) {
2529 fetchCount ++ ;
You can’t perform that action at this time.
0 commit comments