Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1915,21 +1915,6 @@
"count": 1
}
},
"packages/notification-services-controller/src/NotificationServicesPushController/mocks/mockResponse.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 3
}
},
"packages/notification-services-controller/src/NotificationServicesPushController/services/endpoints.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 2
}
},
"packages/notification-services-controller/src/NotificationServicesPushController/services/services.test.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 4
}
},
"packages/notification-services-controller/src/NotificationServicesPushController/services/services.ts": {
"@typescript-eslint/naming-convention": {
"count": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type MockResponse = {

export const MOCK_REG_TOKEN = 'REG_TOKEN';

export const getMockUpdatePushNotificationLinksResponse = () => {
export const getMockUpdatePushNotificationLinksResponse = (): MockResponse => {
return {
url: REGISTRATION_TOKENS_ENDPOINT(),
requestMethod: 'POST',
Expand All @@ -27,15 +27,15 @@ export const MOCK_FCM_RESPONSE = {
},
};

export const getMockCreateFCMRegistrationTokenResponse = () => {
export const getMockCreateFCMRegistrationTokenResponse = (): MockResponse => {
return {
url: /^https:\/\/fcmregistrations\.googleapis\.com\/v1\/projects\/.*$/u,
requestMethod: 'POST',
response: MOCK_FCM_RESPONSE,
} satisfies MockResponse;
};

export const getMockDeleteFCMRegistrationTokenResponse = () => {
export const getMockDeleteFCMRegistrationTokenResponse = (): MockResponse => {
return {
url: /^https:\/\/fcmregistrations\.googleapis\.com\/v1\/projects\/.*$/u,
requestMethod: 'POST',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const PUSH_API_ENV = {
prd: 'https://push.api.cx.metamask.io',
} satisfies Record<ENV, string>;

export const PUSH_API = (env: ENV = 'prd') =>
export const PUSH_API = (env: ENV = 'prd'): string =>
PUSH_API_ENV[env] ?? PUSH_API_ENV.prd;

export const REGISTRATION_TOKENS_ENDPOINT = (env: ENV = 'prd') =>
export const REGISTRATION_TOKENS_ENDPOINT = (env: ENV = 'prd'): string =>
`${PUSH_API(env)}/api/v2/token`;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { mockEndpointUpdatePushNotificationLinks } from '../__fixtures__/mockSer
import type { PushNotificationEnv } from '../types/firebase';

// Testing util to clean up verbose logs when testing errors
const mockErrorLog = () =>
const mockErrorLog = (): jest.SpyInstance =>
jest.spyOn(log, 'error').mockImplementation(jest.fn());

const MOCK_REG_TOKEN = 'REG_TOKEN';
Expand All @@ -19,7 +19,7 @@ const MOCK_JWT = 'MOCK_JWT';

describe('NotificationServicesPushController Services', () => {
describe('updateLinksAPI', () => {
const act = async () =>
const act = async (): Promise<boolean> =>
await updateLinksAPI({
bearerToken: MOCK_JWT,
addresses: MOCK_ADDRESSES,
Expand Down Expand Up @@ -54,6 +54,8 @@ describe('NotificationServicesPushController Services', () => {
});

describe('activatePushNotifications', () => {
// Internal testing utility - return type is inferred
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const arrangeMocks = (override?: { mockPut?: { status: number } }) => {
const params = {
bearerToken: MOCK_JWT,
Expand Down Expand Up @@ -124,6 +126,8 @@ describe('NotificationServicesPushController Services', () => {
});

describe('deactivatePushNotifications', () => {
// Internal testing utility - return type is inferred
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const arrangeMocks = () => {
const params = {
regToken: MOCK_REG_TOKEN,
Expand Down
Loading