diff --git a/app/lib/methods/subscriptions/__tests__/roomSubscription.integration.test.ts b/app/lib/methods/subscriptions/__tests__/roomSubscription.integration.test.ts index fa375f9dec..9c56b86d25 100644 --- a/app/lib/methods/subscriptions/__tests__/roomSubscription.integration.test.ts +++ b/app/lib/methods/subscriptions/__tests__/roomSubscription.integration.test.ts @@ -83,7 +83,6 @@ import { import type { IMockCollection, MockConnection } from '../../../testUtils/sdkIntegration'; import type * as SdkIntegration from '../../../testUtils/sdkIntegration'; -// eslint-disable-next-line @typescript-eslint/no-var-requires const database = require('../../../database').default as { active: { get: jest.Mock; write: jest.Mock; batch: jest.Mock }; }; diff --git a/app/lib/services/__tests__/connect.integration.test.ts b/app/lib/services/__tests__/connect.integration.test.ts index 512c959ed2..ade8f5717c 100644 --- a/app/lib/services/__tests__/connect.integration.test.ts +++ b/app/lib/services/__tests__/connect.integration.test.ts @@ -61,7 +61,6 @@ jest.mock('../../database', () => ({ } })); -// eslint-disable-next-line @typescript-eslint/no-var-requires const database = require('../../database').default as { setActiveDB: jest.Mock; active: { get: jest.Mock; write: jest.Mock; batch: jest.Mock }; diff --git a/app/lib/testUtils/sdkIntegration.ts b/app/lib/testUtils/sdkIntegration.ts index c8dfc58d4f..a08b676cb4 100644 --- a/app/lib/testUtils/sdkIntegration.ts +++ b/app/lib/testUtils/sdkIntegration.ts @@ -1,3 +1,4 @@ +import type * as RocketChatSdk from '@rocket.chat/sdk'; import type { Store } from 'redux'; import type { IApplicationState } from '../../definitions'; @@ -67,15 +68,12 @@ export function receiveFrame(connection: MockConnection, frame: Record ISdkDriver; -}; +const { Rocketchat } = jest.requireActual('@rocket.chat/sdk'); const driverLogger = { debug: jest.fn(), info: jest.fn(), error: jest.fn(), warn: jest.fn() }; export async function buildConnectedDriver(connections: MockConnection[], userId: string): Promise { - const driver = new Driver({ host: 'localhost:3000', logger: driverLogger }); + const driver = new Rocketchat({ host: 'localhost:3000', logger: driverLogger }).driver as unknown as ISdkDriver; driver.userId = userId; const openPromise = driver.socket.open(); connections[0].onopen();