Skip to content

Commit

Permalink
further
Browse files Browse the repository at this point in the history
note i've not been very consistent with how many times i record in a
test, e.g. when EventEmitter called loads of times in a test i often
just record once or per group (think this only applies to
EventEmitter.emit at time of writing)
  • Loading branch information
lawrence-forooghian committed Jun 5, 2024
1 parent bab2dfd commit af1fc28
Show file tree
Hide file tree
Showing 8 changed files with 201 additions and 46 deletions.
5 changes: 4 additions & 1 deletion docs/internal/private-api-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Marked in code.

### `test/realtime/event_emitter.test.js`

Marked in code.

- `eventEmitter.emit('custom');` — RTE6 says that `emit` is internal

### `test/realtime/api.test.js`
Expand All @@ -63,11 +65,12 @@ None

### `test/realtime/crypto.test.js`

Marked in code.

- `var BufferUtils = Ably.Realtime.Platform.BufferUtils;`
- `var msgpack = typeof window == 'object' ? Ably.msgpack : require('@ably/msgpack-js');`
- `Message.encode(testMessage, channelOpts)`
- `Message.decode(encryptedMessage, channelOpts);`
- `Message.fromValues(`
- `expect(channel.channelOptions.cipher.algorithm).to.equal('aes');``channel.channelOptions` is not public API

### `test/realtime/failure.test.js`
Expand Down
46 changes: 28 additions & 18 deletions test/common/modules/private_api_recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,37 @@

define([], function () {
const privateAPIIdentifiers = [
'modifyChannelLastPayload',
'BufferUtils.hexEncode',
'BufferUtils.base64Decode',
'readDefaults.protocolVersion',
'protocolMessageFromDeserialized',
'Utils.mixin',
'PresenceMessage.fromValues',
'replaceChannelSendPresence',
'callChannelSendPresence',
'listen.connectionManager.transport.active',
'replace.transport.send',
'call.transport.send',
'call.BufferUtils.areBuffersEqual',
'call.BufferUtils.base64Decode',
'call.BufferUtils.base64Encode',
'call.BufferUtils.hexEncode',
'call.BufferUtils.isBuffer',
'call.BufferUtils.toArrayBuffer',
'call.EventEmitter.emit',
'call.Message.decode',
'call.Message.encode',
'call.Platform.nextTick',
'call.PresenceMessage.fromValues',
'call.Utils.mixin',
'call.channel.checkPendingState',
'call.channel.processMessage',
'call.channel.sendPresence',
'call.channel.sync',
'call.msgpack.decode',
'call.msgpack.encode',
'call.presence._myMembers.put',
'call.presence.waitSync',
'call.protocolMessageFromDeserialized',
'call.transport.send',
'listen.connectionManager.transport.active',
'read.Defaults.protocolVersion',
'read.EventEmitter.events',
'read.channel.channelOptions.cipher',
'read.connectionManager.connectionId',
'call.presence._myMembers.put',
'call.channel.sync',
'replace.channel.attachImpl',
'call.channel.checkPendingState',
'call.Platform.nextTick',
'call.channel.processMessage',
'call.EventEmitter.emit',
'replace.channel.sendPresence',
'replace.transport.send',
'write.channel._lastPayload',
];

class PrivateApiRecorder {
Expand Down
Loading

0 comments on commit af1fc28

Please sign in to comment.