Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Jul 4, 2024
1 parent 2c38627 commit cf9e279
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/core/test/lib/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2026,8 +2026,7 @@ describe('BaseClient', () => {
}),
);

// @ts-expect-error Accessing private transport API
const mockSend = jest.spyOn(client._transport, 'send').mockImplementation(() => {
const mockSend = jest.spyOn(client['_transport'], 'send').mockImplementation(() => {
return Promise.resolve({ statusCode: 200 });
});

Expand All @@ -2036,8 +2035,7 @@ describe('BaseClient', () => {
const callback = jest.fn();
const removeAfterSendEventListenerFn = client.on('afterSendEvent', callback);

// @ts-expect-error Accessing private client API
expect(client._hooks['afterSendEvent']).toEqual([callback]);
expect(client['_hooks']['afterSendEvent']).toEqual([callback]);

client.sendEvent(errorEvent);
jest.runAllTimers();
Expand All @@ -2052,8 +2050,7 @@ describe('BaseClient', () => {

// Should unregister `afterSendEvent` callback.
removeAfterSendEventListenerFn();
// @ts-expect-error Accessing private client API
expect(client._hooks['afterSendEvent']).toEqual([]);
expect(client['_hooks']['afterSendEvent']).toEqual([]);

client.sendEvent(errorEvent);
jest.runAllTimers();
Expand Down

0 comments on commit cf9e279

Please sign in to comment.