mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Use gate pragma instead of if (__EXPERIMENTAL__) (#19722)
* Use gate pragma instead of if (__EXPERIMENTAL__) * Fix stream error handling in tests Added an error listener so that the tests fail within their Jest scope, instead of crashing the whole process.
This commit is contained in:
+1023
-1011
File diff suppressed because it is too large
Load Diff
+4
-2
@@ -144,9 +144,11 @@ module.exports = function(initModules) {
|
||||
async function renderIntoStream(reactElement, errorCount = 0) {
|
||||
return await expectErrors(
|
||||
() =>
|
||||
new Promise(resolve => {
|
||||
new Promise((resolve, reject) => {
|
||||
const writable = new DrainWritable();
|
||||
ReactDOMServer.renderToNodeStream(reactElement).pipe(writable);
|
||||
const s = ReactDOMServer.renderToNodeStream(reactElement);
|
||||
s.on('error', e => reject(e));
|
||||
s.pipe(writable);
|
||||
writable.on('finish', () => resolve(writable.buffer));
|
||||
}),
|
||||
errorCount,
|
||||
|
||||
Reference in New Issue
Block a user