Skip to content

Commit

Permalink
Add parameterisedTestIdentifier to remaining tests that use private API
Browse files Browse the repository at this point in the history
ones that aren't covered by the big helpers

TODO this actually only covers ones that had private API usage as of the
previous commit (702a49b); need to check other stuff if this is gonna go
into main
  • Loading branch information
lawrence-forooghian committed Jul 8, 2024
1 parent 702a49b commit d7a646b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions test/realtime/crypto.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, Helper, async
}

function single_send(done, helper, realtimeOpts, keyLength) {
// the _128 and _256 variants both call this so it makes more sense for this to be the parameterisedTestTitle instead of that set by testOnAllTransports
helper = helper.withParameterisedTestTitle('single_send');

if (!Crypto) {
done(new Error('Encryption not supported'));
return;
Expand Down Expand Up @@ -467,6 +470,8 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, Helper, async
});

function _multiple_send(done, helper, text, iterations, delay) {
helper = helper.withParameterisedTestTitle('multiple_send');

if (!Crypto) {
done(new Error('Encryption not supported'));
return;
Expand Down
4 changes: 2 additions & 2 deletions test/realtime/failure.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, Helper, async
function nack_on_connection_failure(failureFn, expectedRealtimeState, expectedNackCode) {
return function (done) {
/* Use one transport because stubbing out transport#onProtocolMesage */
var helper = this.test.helper,
var helper = this.test.helper.withParameterisedTestTitle('nack_on_connection_failure'),
realtime = helper.AblyRealtime({ transports: [helper.bestTransport] }),
channel = realtime.channels.get('nack_on_connection_failure');

Expand Down Expand Up @@ -489,7 +489,7 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, Helper, async
});
helper.recordPrivateApi('call.Platform.nextTick');
Ably.Realtime.Platform.Config.nextTick(function () {
failureFn(realtime, helper);
failureFn(realtime, helper.withParameterisedTestTitle(null));
});
},
],
Expand Down
2 changes: 1 addition & 1 deletion test/rest/presence.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, Helper, async

function presence_simple(operation) {
return async function () {
const helper = this.test.helper;
const helper = this.test.helper.withParameterisedTestTitle('presence_simple');
var cipherParams = cipherParamsFromConfig(cipherConfig, helper);
var channel = rest.channels.get('persisted:presence_fixtures', { cipher: cipherParams });
var resultPage = await channel.presence[operation]();
Expand Down
2 changes: 1 addition & 1 deletion test/rest/request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, Helper, async

['put', 'patch', 'delete'].forEach(function (method) {
it('check' + method, async function () {
const helper = this.test.helper;
const helper = this.test.helper.withParameterisedTestTitle('check');
var restEcho = helper.AblyRest({ useBinaryProtocol: false, restHost: echoServerHost, tls: true });
helper.recordPrivateApi('read.Defaults.protocolVersion');
var res = await restEcho.request(method, '/methods', Defaults.protocolVersion, {}, {}, {});
Expand Down

0 comments on commit d7a646b

Please sign in to comment.