Skip to content

Commit 0ab4828

Browse files
author
Karim Piyar Ali
committed
Re-use existing error in test
1 parent e94f924 commit 0ab4828

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎packages/react-server-dom-fb/src/__tests__/ReactDOMServerFB-test.internal.js‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,12 @@ describe('ReactDOMServerFB', () => {
205205
</Suspense>
206206
</div>,
207207
{
208-
onError(x) {
209-
errors.push(x.message);
208+
onError(error) {
209+
errors.push(error);
210210
},
211211
},
212212
);
213-
const reason = 'Test abort reason';
214-
ReactDOMServer.abortStream(stream, new Error(reason));
215-
expect(errors).toEqual([reason]);
213+
ReactDOMServer.abortStream(stream, theError);
214+
expect(errors).toEqual([theError]);
216215
});
217216
});

0 commit comments

Comments
 (0)