diff --git a/packages/subscription-controller/package.json b/packages/subscription-controller/package.json index 53ec901bd32..80e20628aa4 100644 --- a/packages/subscription-controller/package.json +++ b/packages/subscription-controller/package.json @@ -63,7 +63,6 @@ "@types/jest": "^29.5.14", "deepmerge": "^4.2.2", "jest": "^29.7.0", - "sinon": "^9.2.4", "ts-jest": "^29.2.5", "typedoc": "^0.25.13", "typedoc-plugin-missing-exports": "^2.0.0", diff --git a/packages/subscription-controller/src/SubscriptionController.test.ts b/packages/subscription-controller/src/SubscriptionController.test.ts index dc044a635f1..8d527264619 100644 --- a/packages/subscription-controller/src/SubscriptionController.test.ts +++ b/packages/subscription-controller/src/SubscriptionController.test.ts @@ -10,7 +10,6 @@ import { TransactionType, } from '@metamask/transaction-controller'; import type { Hex } from '@metamask/utils'; -import * as sinon from 'sinon'; import { controllerName, @@ -52,7 +51,7 @@ import { SUBSCRIPTION_STATUSES, SubscriptionUserEvent, } from './types'; -import { advanceTime } from '../../../tests/helpers'; +import { jestAdvanceTime } from '../../../tests/helpers'; import { generateMockTxMeta } from '../tests/utils'; type AllActions = MessengerActions; @@ -1047,21 +1046,19 @@ describe('SubscriptionController', () => { }); describe('startPolling', () => { - let clock: sinon.SinonFakeTimers; beforeEach(() => { - // eslint-disable-next-line import-x/namespace - clock = sinon.useFakeTimers(); + jest.useFakeTimers(); }); afterEach(() => { - clock.restore(); + jest.useRealTimers(); }); it('should call getSubscriptions with the correct interval', async () => { await withController(async ({ controller }) => { const getSubscriptionsSpy = jest.spyOn(controller, 'getSubscriptions'); controller.startPolling({}); - await advanceTime({ clock, duration: 0 }); + await jestAdvanceTime({ duration: 0 }); expect(getSubscriptionsSpy).toHaveBeenCalledTimes(1); }); }); @@ -1076,7 +1073,7 @@ describe('SubscriptionController', () => { 'triggerAccessTokenRefresh', ); controller.startPolling({}); - await advanceTime({ clock, duration: 0 }); + await jestAdvanceTime({ duration: 0 }); expect(triggerAccessTokenRefreshSpy).toHaveBeenCalledTimes(1); }); }); diff --git a/yarn.lock b/yarn.lock index 5b7987d11fc..cfaf7684b57 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4968,7 +4968,6 @@ __metadata: bignumber.js: "npm:^9.1.2" deepmerge: "npm:^4.2.2" jest: "npm:^29.7.0" - sinon: "npm:^9.2.4" ts-jest: "npm:^29.2.5" typedoc: "npm:^0.25.13" typedoc-plugin-missing-exports: "npm:^2.0.0"