From 95a5efc160edcea8377b88316efe9930c3fb3e14 Mon Sep 17 00:00:00 2001 From: Josh Story Date: Tue, 31 Oct 2023 18:18:32 -0700 Subject: [PATCH] add test --- .../src/__tests__/ReactFlightDOMReply-test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js index 019d28a00ce98..ed2f8a8f566bb 100644 --- a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js +++ b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js @@ -231,4 +231,14 @@ describe('ReactFlightDOMReply', () => { expect(s2.has('hi')).toBe(true); expect(s2).toEqual(s); }); + + it('does not hang indefinitely when calling decodeReply with FormData', async () => { + let error; + try { + await ReactServerDOMServer.decodeReply(new FormData(), webpackServerMap); + } catch (e) { + error = e; + } + expect(error.message).toBe('Connection closed.'); + }); });