From a9c81c3a673d126f229dfb172815e6977cdfef8a Mon Sep 17 00:00:00 2001 From: ruben-rebelo Date: Tue, 13 Feb 2024 17:46:17 +0000 Subject: [PATCH 1/7] [TS migration] Migrate GithubUtilsTest to typescript --- ...{GithubUtilsTest.js => GithubUtilsTest.ts} | 86 +++++++++++++++++-- 1 file changed, 77 insertions(+), 9 deletions(-) rename tests/unit/{GithubUtilsTest.js => GithubUtilsTest.ts} (90%) diff --git a/tests/unit/GithubUtilsTest.js b/tests/unit/GithubUtilsTest.ts similarity index 90% rename from tests/unit/GithubUtilsTest.js rename to tests/unit/GithubUtilsTest.ts index b2b84dfd9d9f..f7d971f9a723 100644 --- a/tests/unit/GithubUtilsTest.js +++ b/tests/unit/GithubUtilsTest.ts @@ -1,12 +1,65 @@ /** * @jest-environment node */ -const core = require('@actions/core'); -const GithubUtils = require('../../.github/libs/GithubUtils'); +import core from '@actions/core'; +import GithubUtils from '../../.github/libs/GithubUtils'; const mockGetInput = jest.fn(); const mockListIssues = jest.fn(); +type DeployBlockers = { + url: string; + number: number; + isResolved: boolean; +}; + +type ExpectedReponse = { + PRList: Array<{ + url: string; + number: number; + isVerified: boolean; + }>; + labels: Array<{ + color: string; + default: boolean; + description: string; + id: number; + name: string; + // eslint-disable-next-line @typescript-eslint/naming-convention + node_id: string; + url: string; + }>; + tag: string; + title: string; + url: string; + number: number; + deployBlockers: DeployBlockers[] | null; + internalQAPRList: string[]; + isTimingDashboardChecked: boolean; + isFirebaseChecked: boolean; + isGHStatusChecked: boolean; +}; + +type Issue = { + url: string; + title: string; + labels: Array<{ + id: number; + // eslint-disable-next-line @typescript-eslint/naming-convention + node_id: string; + url: string; + name: string; + color: string; + default: boolean; + description: string; + }>; + body: string; +}; + +type ObjectMethodData = { + data: T; +}; + beforeAll(() => { // Mock core module core.getInput = mockGetInput; @@ -19,6 +72,7 @@ beforeAll(() => { Promise.resolve({ data: { ...arg, + // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/issues/29', }, }), @@ -26,8 +80,10 @@ beforeAll(() => { listForRepo: mockListIssues, }, }, - paginate: jest.fn().mockImplementation((objectMethod) => objectMethod().then(({data}) => data)), + paginate: jest.fn().mockImplementation((objectMethod: () => Promise<{data: Record}>) => objectMethod().then(({data}) => data)), }; + + // @ts-expect-error TODO: Remove this once GithubUtils (https://github.com/Expensify/App/issues/25382) is migrated to TypeScript. GithubUtils.internalOctokit = moctokit; }); @@ -38,12 +94,13 @@ afterEach(() => { describe('GithubUtils', () => { describe('getStagingDeployCash', () => { - const baseIssue = { + const baseIssue: Issue = { url: 'https://api.github.com/repos/Andrew-Test-Org/Public-Test-Repo/issues/29', title: 'Andrew Test Issue', labels: [ { id: 2783847782, + // eslint-disable-next-line @typescript-eslint/naming-convention node_id: 'MDU6TGFiZWwyNzgzODQ3Nzgy', url: 'https://api.github.com/repos/Andrew-Test-Org/Public-Test-Repo/labels/StagingDeployCash', name: 'StagingDeployCash', @@ -60,7 +117,7 @@ describe('GithubUtils', () => { issueWithDeployBlockers.body += '\r\n**Deploy Blockers:**\r\n- [ ] https://github.com/Expensify/App/issues/1\r\n- [x] https://github.com/Expensify/App/issues/2\r\n- [ ] https://github.com/Expensify/App/pull/1234\r\n'; - const baseExpectedResponse = { + const baseExpectedResponse: ExpectedReponse = { PRList: [ { url: 'https://github.com/Expensify/App/pull/21', @@ -85,6 +142,7 @@ describe('GithubUtils', () => { description: '', id: 2783847782, name: 'StagingDeployCash', + // eslint-disable-next-line @typescript-eslint/naming-convention node_id: 'MDU6TGFiZWwyNzgzODQ3Nzgy', url: 'https://api.github.com/repos/Andrew-Test-Org/Public-Test-Repo/labels/StagingDeployCash', }, @@ -93,7 +151,7 @@ describe('GithubUtils', () => { title: 'Andrew Test Issue', url: 'https://api.github.com/repos/Andrew-Test-Org/Public-Test-Repo/issues/29', number: 29, - deployBlockers: [], + deployBlockers: null, internalQAPRList: [], isTimingDashboardChecked: false, isFirebaseChecked: false, @@ -119,13 +177,13 @@ describe('GithubUtils', () => { ]; test('Test finding an open issue with no PRs successfully', () => { - const bareIssue = { + const bareIssue: Issue = { ...baseIssue, // eslint-disable-next-line max-len body: '**Release Version:** `1.0.1-47`\r\n**Compare Changes:** https://github.com/Expensify/App/compare/production...staging\r\n\r\ncc @Expensify/applauseleads\n', }; - const bareExpectedResponse = { + const bareExpectedResponse: ExpectedReponse = { ...baseExpectedResponse, PRList: [], }; @@ -259,6 +317,7 @@ describe('GithubUtils', () => { { number: 1, title: 'Test PR 1', + // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/1', user: {login: 'testUser'}, labels: [], @@ -266,6 +325,7 @@ describe('GithubUtils', () => { { number: 2, title: 'Test PR 2', + // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/2', user: {login: 'testUser'}, labels: [], @@ -273,6 +333,7 @@ describe('GithubUtils', () => { { number: 3, title: 'Test PR 3', + // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/3', user: {login: 'testUser'}, labels: [], @@ -280,6 +341,7 @@ describe('GithubUtils', () => { { number: 4, title: '[NO QA] Test No QA PR uppercase', + // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/4', user: {login: 'testUser'}, labels: [], @@ -287,6 +349,7 @@ describe('GithubUtils', () => { { number: 5, title: '[NoQa] Test No QA PR Title Case', + // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/5', user: {login: 'testUser'}, labels: [], @@ -294,11 +357,13 @@ describe('GithubUtils', () => { { number: 6, title: '[Internal QA] Test Internal QA PR', + // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/6', user: {login: 'testUser'}, labels: [ { id: 1234, + // eslint-disable-next-line @typescript-eslint/naming-convention node_id: 'MDU6TGFiZWwyMDgwNDU5NDY=', url: 'https://api.github.com/Expensify/App/labels/InternalQA', name: 'InternalQA', @@ -318,11 +383,13 @@ describe('GithubUtils', () => { { number: 7, title: '[Internal QA] Another Test Internal QA PR', + // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/7', user: {login: 'testUser'}, labels: [ { id: 1234, + // eslint-disable-next-line @typescript-eslint/naming-convention node_id: 'MDU6TGFiZWwyMDgwNDU5NDY=', url: 'https://api.github.com/Expensify/App/labels/InternalQA', name: 'InternalQA', @@ -350,12 +417,13 @@ describe('GithubUtils', () => { list: jest.fn().mockResolvedValue({data: mockPRs}), }, }, - paginate: jest.fn().mockImplementation((objectMethod) => objectMethod().then(({data}) => data)), + paginate: jest.fn().mockImplementation((objectMethod: () => Promise>) => objectMethod().then(({data}) => data)), }), })); const octokit = mockGithub().getOctokit(); const githubUtils = class extends GithubUtils {}; + // @ts-expect-error TODO: Remove this once GithubUtils (https://github.com/Expensify/App/issues/25382) is migrated to TypeScript. githubUtils.internalOctokit = octokit; const tag = '1.0.2-12'; const basePRList = [ From eb8a2cdc627e80401b0e88d30d8bd0c0ecacee1f Mon Sep 17 00:00:00 2001 From: ruben-rebelo Date: Tue, 13 Feb 2024 18:06:15 +0000 Subject: [PATCH 2/7] [TS migration] Code improvements --- tests/unit/GithubUtilsTest.ts | 82 +++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/tests/unit/GithubUtilsTest.ts b/tests/unit/GithubUtilsTest.ts index f7d971f9a723..716fc2a4d5a8 100644 --- a/tests/unit/GithubUtilsTest.ts +++ b/tests/unit/GithubUtilsTest.ts @@ -1,7 +1,7 @@ /** * @jest-environment node */ -import core from '@actions/core'; +import * as core from '@actions/core'; import GithubUtils from '../../.github/libs/GithubUtils'; const mockGetInput = jest.fn(); @@ -33,7 +33,7 @@ type ExpectedReponse = { title: string; url: string; number: number; - deployBlockers: DeployBlockers[] | null; + deployBlockers: DeployBlockers[]; internalQAPRList: string[]; isTimingDashboardChecked: boolean; isFirebaseChecked: boolean; @@ -60,9 +60,13 @@ type ObjectMethodData = { data: T; }; +type Mutable = {-readonly [P in keyof T]: T[P]}; + +const asMutable = (value: T): Mutable => value as Mutable; + beforeAll(() => { // Mock core module - core.getInput = mockGetInput; + asMutable(core).getInput = mockGetInput; // Mock octokit module const moctokit = { @@ -80,7 +84,7 @@ beforeAll(() => { listForRepo: mockListIssues, }, }, - paginate: jest.fn().mockImplementation((objectMethod: () => Promise<{data: Record}>) => objectMethod().then(({data}) => data)), + paginate: jest.fn().mockImplementation((objectMethod: () => Promise>) => objectMethod().then(({data}) => data)), }; // @ts-expect-error TODO: Remove this once GithubUtils (https://github.com/Expensify/App/issues/25382) is migrated to TypeScript. @@ -151,7 +155,7 @@ describe('GithubUtils', () => { title: 'Andrew Test Issue', url: 'https://api.github.com/repos/Andrew-Test-Org/Public-Test-Repo/issues/29', number: 29, - deployBlockers: null, + deployBlockers: [], internalQAPRList: [], isTimingDashboardChecked: false, isFirebaseChecked: false, @@ -251,7 +255,9 @@ describe('GithubUtils', () => { ['https://github.com/Expensify/Expensify/issues/156481'], ['https://docs.google.com/document/d/1mMFh-m1seOES48r3zNqcvfuTvr3qOAsY6n5rP4ejdXE/edit?ts=602420d2#'], ])('getPullRequestNumberFromURL("%s")', (input) => { - expect(() => GithubUtils.getPullRequestNumberFromURL(input)).toThrow(new Error(`Provided URL ${input} is not a Github Pull Request!`)); + expect(() => { + GithubUtils.getPullRequestNumberFromURL(input); + }).toThrow(new Error(`Provided URL ${input} is not a Github Pull Request!`)); }); }); }); @@ -276,7 +282,9 @@ describe('GithubUtils', () => { ['https://github.com/Expensify/Expensify/pull/156481'], ['https://docs.google.com/document/d/1mMFh-m1seOES48r3zNqcvfuTvr3qOAsY6n5rP4ejdXE/edit?ts=602420d2#'], ])('getIssueNumberFromURL("%s")', (input) => { - expect(() => GithubUtils.getIssueNumberFromURL(input)).toThrow(new Error(`Provided URL ${input} is not a Github Issue!`)); + expect(() => { + GithubUtils.getIssueNumberFromURL(input); + }).toThrow(new Error(`Provided URL ${input} is not a Github Issue!`)); }); }); }); @@ -305,7 +313,9 @@ describe('GithubUtils', () => { test.each([['https://www.google.com/'], ['https://docs.google.com/document/d/1mMFh-m1seOES48r3zNqcvfuTvr3qOAsY6n5rP4ejdXE/edit?ts=602420d2#']])( 'getIssueOrPullRequestNumberFromURL("%s")', (input) => { - expect(() => GithubUtils.getIssueOrPullRequestNumberFromURL(input)).toThrow(new Error(`Provided URL ${input} is not a valid Github Issue or Pull Request!`)); + expect(() => { + GithubUtils.getIssueOrPullRequestNumberFromURL(input); + }).toThrow(new Error(`Provided URL ${input} is not a valid Github Issue or Pull Request!`)); }, ); }); @@ -472,8 +482,8 @@ describe('GithubUtils', () => { `${lineBreak}${closedCheckbox}${basePRList[5]}` + `${lineBreak}`; - test('Test no verified PRs', () => - githubUtils.generateStagingDeployCashBody(tag, basePRList).then((issueBody) => { + test('Test no verified PRs', () => { + githubUtils.generateStagingDeployCashBody(tag, basePRList).then((issueBody: string) => { expect(issueBody).toBe( `${baseExpectedOutput}` + `${openCheckbox}${basePRList[2]}` + @@ -487,10 +497,11 @@ describe('GithubUtils', () => { `${lineBreak}${openCheckbox}${ghVerification}` + `${lineBreakDouble}${ccApplauseLeads}`, ); - })); + }); + }); - test('Test some verified PRs', () => - githubUtils.generateStagingDeployCashBody(tag, basePRList, [basePRList[0]]).then((issueBody) => { + test('Test some verified PRs', () => { + githubUtils.generateStagingDeployCashBody(tag, basePRList, [basePRList[0]]).then((issueBody: string) => { expect(issueBody).toBe( `${baseExpectedOutput}` + `${openCheckbox}${basePRList[2]}` + @@ -504,10 +515,11 @@ describe('GithubUtils', () => { `${lineBreak}${openCheckbox}${ghVerification}` + `${lineBreakDouble}${ccApplauseLeads}`, ); - })); + }); + }); - test('Test all verified PRs', () => - githubUtils.generateStagingDeployCashBody(tag, basePRList, basePRList).then((issueBody) => { + test('Test all verified PRs', () => { + githubUtils.generateStagingDeployCashBody(tag, basePRList, basePRList).then((issueBody: string) => { expect(issueBody).toBe( `${allVerifiedExpectedOutput}` + `${lineBreak}${deployerVerificationsHeader}` + @@ -516,10 +528,11 @@ describe('GithubUtils', () => { `${lineBreak}${openCheckbox}${ghVerification}` + `${lineBreakDouble}${ccApplauseLeads}`, ); - })); + }); + }); - test('Test no resolved deploy blockers', () => - githubUtils.generateStagingDeployCashBody(tag, basePRList, basePRList, baseDeployBlockerList).then((issueBody) => { + test('Test no resolved deploy blockers', () => { + githubUtils.generateStagingDeployCashBody(tag, basePRList, basePRList, baseDeployBlockerList).then((issueBody: string) => { expect(issueBody).toBe( `${allVerifiedExpectedOutput}` + `${lineBreak}${deployBlockerHeader}` + @@ -531,10 +544,11 @@ describe('GithubUtils', () => { `${lineBreak}${openCheckbox}${ghVerification}${lineBreak}` + `${lineBreak}${ccApplauseLeads}`, ); - })); + }); + }); - test('Test some resolved deploy blockers', () => - githubUtils.generateStagingDeployCashBody(tag, basePRList, basePRList, baseDeployBlockerList, [baseDeployBlockerList[0]]).then((issueBody) => { + test('Test some resolved deploy blockers', () => { + githubUtils.generateStagingDeployCashBody(tag, basePRList, basePRList, baseDeployBlockerList, [baseDeployBlockerList[0]]).then((issueBody: string) => { expect(issueBody).toBe( `${allVerifiedExpectedOutput}` + `${lineBreak}${deployBlockerHeader}` + @@ -546,10 +560,11 @@ describe('GithubUtils', () => { `${lineBreak}${openCheckbox}${ghVerification}` + `${lineBreakDouble}${ccApplauseLeads}`, ); - })); + }); + }); - test('Test all resolved deploy blockers', () => - githubUtils.generateStagingDeployCashBody(tag, basePRList, basePRList, baseDeployBlockerList, baseDeployBlockerList).then((issueBody) => { + test('Test all resolved deploy blockers', () => { + githubUtils.generateStagingDeployCashBody(tag, basePRList, basePRList, baseDeployBlockerList, baseDeployBlockerList).then((issueBody: string) => { expect(issueBody).toBe( `${baseExpectedOutput}` + `${closedCheckbox}${basePRList[2]}` + @@ -566,10 +581,11 @@ describe('GithubUtils', () => { `${lineBreak}${openCheckbox}${ghVerification}` + `${lineBreakDouble}${ccApplauseLeads}`, ); - })); + }); + }); - test('Test internalQA PRs', () => - githubUtils.generateStagingDeployCashBody(tag, [...basePRList, ...internalQAPRList]).then((issueBody) => { + test('Test internalQA PRs', () => { + githubUtils.generateStagingDeployCashBody(tag, [...basePRList, ...internalQAPRList]).then((issueBody: string) => { expect(issueBody).toBe( `${baseExpectedOutput}` + `${openCheckbox}${basePRList[2]}` + @@ -586,10 +602,11 @@ describe('GithubUtils', () => { `${lineBreak}${openCheckbox}${ghVerification}` + `${lineBreakDouble}${ccApplauseLeads}`, ); - })); + }); + }); - test('Test some verified internalQA PRs', () => - githubUtils.generateStagingDeployCashBody(tag, [...basePRList, ...internalQAPRList], [], [], [], [internalQAPRList[0]]).then((issueBody) => { + test('Test some verified internalQA PRs', () => { + githubUtils.generateStagingDeployCashBody(tag, [...basePRList, ...internalQAPRList], [], [], [], [internalQAPRList[0]]).then((issueBody: string) => { expect(issueBody).toBe( `${baseExpectedOutput}` + `${openCheckbox}${basePRList[2]}` + @@ -606,7 +623,8 @@ describe('GithubUtils', () => { `${lineBreak}${openCheckbox}${ghVerification}` + `${lineBreakDouble}${ccApplauseLeads}`, ); - })); + }); + }); }); describe('getPullRequestURLFromNumber', () => { From ed6b6b2af1f6762a23414163758fcf7e99080826 Mon Sep 17 00:00:00 2001 From: ruben-rebelo Date: Wed, 14 Feb 2024 13:05:55 +0000 Subject: [PATCH 3/7] [TS migration][GithubUtilsTest] Addressed feedback --- tests/unit/GithubUtilsTest.ts | 48 ++++++++++++++++------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/tests/unit/GithubUtilsTest.ts b/tests/unit/GithubUtilsTest.ts index 716fc2a4d5a8..157af6d68ae3 100644 --- a/tests/unit/GithubUtilsTest.ts +++ b/tests/unit/GithubUtilsTest.ts @@ -13,22 +13,28 @@ type DeployBlockers = { isResolved: boolean; }; +type PR = { + url: string; + number: number; + isVerified: boolean; +}; + +type Label = { + id: number; + number?: number; + isVerified?: boolean; + // eslint-disable-next-line @typescript-eslint/naming-convention + node_id: string; + url: string; + name: string; + color: string; + default: boolean; + description: string; +}; + type ExpectedReponse = { - PRList: Array<{ - url: string; - number: number; - isVerified: boolean; - }>; - labels: Array<{ - color: string; - default: boolean; - description: string; - id: number; - name: string; - // eslint-disable-next-line @typescript-eslint/naming-convention - node_id: string; - url: string; - }>; + PRList: PR[]; + labels: Label[]; tag: string; title: string; url: string; @@ -43,16 +49,7 @@ type ExpectedReponse = { type Issue = { url: string; title: string; - labels: Array<{ - id: number; - // eslint-disable-next-line @typescript-eslint/naming-convention - node_id: string; - url: string; - name: string; - color: string; - default: boolean; - description: string; - }>; + labels: Label[]; body: string; }; @@ -87,7 +84,6 @@ beforeAll(() => { paginate: jest.fn().mockImplementation((objectMethod: () => Promise>) => objectMethod().then(({data}) => data)), }; - // @ts-expect-error TODO: Remove this once GithubUtils (https://github.com/Expensify/App/issues/25382) is migrated to TypeScript. GithubUtils.internalOctokit = moctokit; }); From c37bbba5b2732aa3a7a074e8275c03ae4f2ae1f8 Mon Sep 17 00:00:00 2001 From: ruben-rebelo Date: Tue, 20 Feb 2024 09:55:09 +0000 Subject: [PATCH 4/7] [TS migration][GithubUtilsTest] Added missing TODO --- tests/unit/GithubUtilsTest.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/GithubUtilsTest.ts b/tests/unit/GithubUtilsTest.ts index 157af6d68ae3..48ee44c7ded3 100644 --- a/tests/unit/GithubUtilsTest.ts +++ b/tests/unit/GithubUtilsTest.ts @@ -84,6 +84,7 @@ beforeAll(() => { paginate: jest.fn().mockImplementation((objectMethod: () => Promise>) => objectMethod().then(({data}) => data)), }; + // @ts-expect-error TODO: Remove this once GithubUtils (https://github.com/Expensify/App/issues/25382) is migrated to TypeScript. GithubUtils.internalOctokit = moctokit; }); From a6cf95a72a71974e850387cb4d0cc752b981e1d4 Mon Sep 17 00:00:00 2001 From: ruben-rebelo Date: Tue, 20 Feb 2024 09:56:02 +0000 Subject: [PATCH 5/7] [TS migration][GithubUtilsTest] Feedback --- tests/unit/GithubUtilsTest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/GithubUtilsTest.ts b/tests/unit/GithubUtilsTest.ts index 48ee44c7ded3..d7bd19076501 100644 --- a/tests/unit/GithubUtilsTest.ts +++ b/tests/unit/GithubUtilsTest.ts @@ -13,7 +13,7 @@ type DeployBlockers = { isResolved: boolean; }; -type PR = { +type PullRequest = { url: string; number: number; isVerified: boolean; @@ -33,7 +33,7 @@ type Label = { }; type ExpectedReponse = { - PRList: PR[]; + PRList: PullRequest[]; labels: Label[]; tag: string; title: string; From 4535da7b9452cd9616faeed4b50c1fe77bbec276 Mon Sep 17 00:00:00 2001 From: ruben-rebelo Date: Tue, 20 Feb 2024 12:56:45 +0000 Subject: [PATCH 6/7] [TS migration][GIthubutilstest] Updated with typefest --- tests/unit/GithubUtilsTest.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/unit/GithubUtilsTest.ts b/tests/unit/GithubUtilsTest.ts index d7bd19076501..9af5ecb72f2e 100644 --- a/tests/unit/GithubUtilsTest.ts +++ b/tests/unit/GithubUtilsTest.ts @@ -2,6 +2,7 @@ * @jest-environment node */ import * as core from '@actions/core'; +import type {Writable} from 'type-fest'; import GithubUtils from '../../.github/libs/GithubUtils'; const mockGetInput = jest.fn(); @@ -57,9 +58,7 @@ type ObjectMethodData = { data: T; }; -type Mutable = {-readonly [P in keyof T]: T[P]}; - -const asMutable = (value: T): Mutable => value as Mutable; +const asMutable = (value: T): Writable => value as Writable; beforeAll(() => { // Mock core module From 960ebb72882f1f999d234a3c27738f87fa47eba1 Mon Sep 17 00:00:00 2001 From: ruben-rebelo Date: Tue, 20 Feb 2024 15:58:12 +0000 Subject: [PATCH 7/7] [TS migration][GithubUtilsTest] Disabled name convention rule for the entire file --- tests/unit/GithubUtilsTest.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/tests/unit/GithubUtilsTest.ts b/tests/unit/GithubUtilsTest.ts index 9af5ecb72f2e..794139286527 100644 --- a/tests/unit/GithubUtilsTest.ts +++ b/tests/unit/GithubUtilsTest.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + /** * @jest-environment node */ @@ -24,7 +26,6 @@ type Label = { id: number; number?: number; isVerified?: boolean; - // eslint-disable-next-line @typescript-eslint/naming-convention node_id: string; url: string; name: string; @@ -72,7 +73,6 @@ beforeAll(() => { Promise.resolve({ data: { ...arg, - // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/issues/29', }, }), @@ -100,7 +100,6 @@ describe('GithubUtils', () => { labels: [ { id: 2783847782, - // eslint-disable-next-line @typescript-eslint/naming-convention node_id: 'MDU6TGFiZWwyNzgzODQ3Nzgy', url: 'https://api.github.com/repos/Andrew-Test-Org/Public-Test-Repo/labels/StagingDeployCash', name: 'StagingDeployCash', @@ -142,7 +141,6 @@ describe('GithubUtils', () => { description: '', id: 2783847782, name: 'StagingDeployCash', - // eslint-disable-next-line @typescript-eslint/naming-convention node_id: 'MDU6TGFiZWwyNzgzODQ3Nzgy', url: 'https://api.github.com/repos/Andrew-Test-Org/Public-Test-Repo/labels/StagingDeployCash', }, @@ -323,7 +321,6 @@ describe('GithubUtils', () => { { number: 1, title: 'Test PR 1', - // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/1', user: {login: 'testUser'}, labels: [], @@ -331,7 +328,6 @@ describe('GithubUtils', () => { { number: 2, title: 'Test PR 2', - // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/2', user: {login: 'testUser'}, labels: [], @@ -339,7 +335,6 @@ describe('GithubUtils', () => { { number: 3, title: 'Test PR 3', - // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/3', user: {login: 'testUser'}, labels: [], @@ -347,7 +342,6 @@ describe('GithubUtils', () => { { number: 4, title: '[NO QA] Test No QA PR uppercase', - // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/4', user: {login: 'testUser'}, labels: [], @@ -355,7 +349,6 @@ describe('GithubUtils', () => { { number: 5, title: '[NoQa] Test No QA PR Title Case', - // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/5', user: {login: 'testUser'}, labels: [], @@ -363,13 +356,11 @@ describe('GithubUtils', () => { { number: 6, title: '[Internal QA] Test Internal QA PR', - // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/6', user: {login: 'testUser'}, labels: [ { id: 1234, - // eslint-disable-next-line @typescript-eslint/naming-convention node_id: 'MDU6TGFiZWwyMDgwNDU5NDY=', url: 'https://api.github.com/Expensify/App/labels/InternalQA', name: 'InternalQA', @@ -389,13 +380,11 @@ describe('GithubUtils', () => { { number: 7, title: '[Internal QA] Another Test Internal QA PR', - // eslint-disable-next-line @typescript-eslint/naming-convention html_url: 'https://github.com/Expensify/App/pull/7', user: {login: 'testUser'}, labels: [ { id: 1234, - // eslint-disable-next-line @typescript-eslint/naming-convention node_id: 'MDU6TGFiZWwyMDgwNDU5NDY=', url: 'https://api.github.com/Expensify/App/labels/InternalQA', name: 'InternalQA',