From c4fa06938b676a3e5b0599e94716eb16d27f974b Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 29 Jan 2024 14:00:35 -0800 Subject: [PATCH 1/2] Add valid response to not error in tests --- test/integration/client_headers_test.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/integration/client_headers_test.js b/test/integration/client_headers_test.js index 46c856927..e070d7e0c 100644 --- a/test/integration/client_headers_test.js +++ b/test/integration/client_headers_test.js @@ -44,7 +44,14 @@ describe("integration tests: client headers", function (done) { let query = url.parse(request.url, true).query; expect(query["X-Client-Name"]).to.be.equal("js-stellar-sdk"); expect(query["X-Client-Version"]).to.match(versionPattern); + + // write a valid event stream so that we don't error prematurely + response.writeHead(200, { + "Content-Type": "text/event-stream", + }); + response.write("retry: 10\nevent: close\ndata: byebye\n\n"); response.end(); + server.close(() => { closeStream(); done(); @@ -62,11 +69,7 @@ describe("integration tests: client headers", function (done) { allowHttp: true, }) .operations() - .stream({ - onerror: (err) => { - done(err); - }, - }); + .stream({ onerror: (err) => done(err) }); }); }); }); From 5ee7b1d41703f987f287aca9e734aad9cee4ea16 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 29 Jan 2024 14:03:16 -0800 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d54c1a856..51863195a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ A breaking change will get clearly marked in this log. ## Unreleased +### Fixed +* Event streaming tests now pass on Node 20, which seems to have tighter conformance to the spec ([#917](https://github.com/stellar/js-stellar-sdk/pull/917)). + ## [v11.2.1](https://github.com/stellar/js-stellar-sdk/compare/v11.2.0...v11.2.1)