Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that event streaming tests write a valid stream #917

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
13 changes: 8 additions & 5 deletions test/integration/client_headers_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -62,11 +69,7 @@ describe("integration tests: client headers", function (done) {
allowHttp: true,
})
.operations()
.stream({
onerror: (err) => {
done(err);
},
});
.stream({ onerror: (err) => done(err) });
});
});
});
Loading