Skip to content

Commit

Permalink
[UTS] Disable use of bestTransport / availableTransport private APIs
Browse files Browse the repository at this point in the history
This is part of removing some common private API usage for the unified
test suite.

As mentioned in cfc66aa, client libraries running in unified test suite
are expected to only use WebSocket transport.
  • Loading branch information
lawrence-forooghian committed Jul 25, 2024
1 parent cfc66aa commit 73b6b4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
17 changes: 1 addition & 16 deletions test/common/modules/shared_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,25 +121,10 @@ define([
}

get availableTransports() {
const helper = this.addingHelperFunction('availableTransports');
return helper._availableTransports;
}

get _availableTransports() {
this.recordPrivateApi('call.Utils.keysArray');
this.recordPrivateApi('call.ConnectionManager.supportedTransports');
this.recordPrivateApi('read.Realtime._transports');
return utils.keysArray(
clientModule.Ably.Realtime.ConnectionManager.supportedTransports(clientModule.Ably.Realtime._transports),
);
return ['web_socket'];
}

get bestTransport() {
const helper = this.addingHelperFunction('bestTransport');
return helper._bestTransport;
}

get _bestTransport() {
return this.availableTransports[0];
}

Expand Down
3 changes: 2 additions & 1 deletion test/realtime/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ define(['ably', 'shared_helper', 'chai'], function (Ably, Helper, chai) {
try {
realtime = helper.AblyRealtime({ transports: helper.availableTransports });
helper.recordPrivateApi('read.connectionManager.baseTransport');
expect(realtime.connection.connectionManager.baseTransport).to.equal('comet');
// There’s no base transport now that we’re only specifiying web_socket
//expect(realtime.connection.connectionManager.baseTransport).to.equal('comet');
helper.recordPrivateApi('read.connectionManager.webSocketTransportAvailable');
expect(realtime.connection.connectionManager.webSocketTransportAvailable).to.be.ok;
helper.closeAndFinish(done, realtime);
Expand Down

0 comments on commit 73b6b4c

Please sign in to comment.