diff --git a/__tests__/backend/utils/SafeDriveService.test.ts b/__tests__/backend/utils/SafeDriveService.test.ts index 577abec2..8c6681f0 100644 --- a/__tests__/backend/utils/SafeDriveService.test.ts +++ b/__tests__/backend/utils/SafeDriveService.test.ts @@ -1,22 +1,10 @@ import { expect, test } from "@jest/globals"; import { SafeDriveService_ } from "../../../src/backend/utils/SafeDriveService"; -import { - mockedCommentsCollection, - mockedDrive, - mockedDrivesCollection, - mockedFilesCollection, - mockedRepliesCollection, -} from "../../test-utils/gas-stubs"; +import { mockedDrive } from "../../test-utils/gas-stubs"; test("SafeDriveService constructs correctly", () => { - global.Drive = { - ...mockedDrive(), - Comments: mockedCommentsCollection(), - Drives: mockedDrivesCollection(), - Files: mockedFilesCollection(), - Replies: mockedRepliesCollection(), - }; + global.Drive = mockedDrive(); expect(() => { new SafeDriveService_(); diff --git a/__tests__/backend/utils/SafeDriveService/SafeCommentsCollection.test.ts b/__tests__/backend/utils/SafeDriveService/SafeCommentsCollection.test.ts index ad69146f..6fb388fb 100644 --- a/__tests__/backend/utils/SafeDriveService/SafeCommentsCollection.test.ts +++ b/__tests__/backend/utils/SafeDriveService/SafeCommentsCollection.test.ts @@ -2,16 +2,10 @@ import { expect, test } from "@jest/globals"; import { mocked } from "jest-mock"; import { SafeCommentsCollection_ } from "../../../../src/backend/utils/SafeDriveService/SafeCommentsCollection"; -import { - mockedCommentsCollection, - mockedDrive, -} from "../../../test-utils/gas-stubs"; +import { mockedDrive } from "../../../test-utils/gas-stubs"; test("SafeCommentsCollection constructs correctly", () => { - global.Drive = { - ...mockedDrive(), - Comments: mockedCommentsCollection(), - }; + global.Drive = mockedDrive(); expect(() => { new SafeCommentsCollection_(); @@ -37,7 +31,7 @@ test("create works", () => { ], }; - global.Drive.Comments = mockedCommentsCollection(); + global.Drive = mockedDrive(); const create = mocked(global.Drive.Comments).create.mockReturnValueOnce( comment, ); @@ -69,7 +63,7 @@ test("create throws an error on an invalid comment", () => { ], }; - global.Drive.Comments = mockedCommentsCollection(); + global.Drive = mockedDrive(); const create = mocked(global.Drive.Comments).create.mockReturnValueOnce( comment, ); @@ -123,7 +117,7 @@ test("list works", () => { ], }; - global.Drive.Comments = mockedCommentsCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Comments).list.mockReturnValueOnce( commentList, ); @@ -177,7 +171,7 @@ test("list works with optional arguments", () => { ], }; - global.Drive.Comments = mockedCommentsCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Comments).list.mockReturnValueOnce( commentList, ); @@ -238,7 +232,7 @@ test("list throws an error on an invalid comment", () => { ], }; - global.Drive.Comments = mockedCommentsCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Comments).list.mockReturnValueOnce( commentList, ); @@ -257,7 +251,7 @@ test("list throws an error on an invalid comment list", () => { nextPageToken: "TOKEN", }; - global.Drive.Comments = mockedCommentsCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Comments).list.mockReturnValueOnce( commentList, ); @@ -302,7 +296,7 @@ test("list throws an error on missing replies", () => { ], }; - global.Drive.Comments = mockedCommentsCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Comments).list.mockReturnValueOnce( commentList, ); @@ -355,7 +349,7 @@ test("list throws an error on an invalid reply", () => { ], }; - global.Drive.Comments = mockedCommentsCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Comments).list.mockReturnValueOnce( commentList, ); diff --git a/__tests__/backend/utils/SafeDriveService/SafeDrivesCollection.test.ts b/__tests__/backend/utils/SafeDriveService/SafeDrivesCollection.test.ts index 22853d1e..7b21090e 100644 --- a/__tests__/backend/utils/SafeDriveService/SafeDrivesCollection.test.ts +++ b/__tests__/backend/utils/SafeDriveService/SafeDrivesCollection.test.ts @@ -2,16 +2,10 @@ import { expect, test } from "@jest/globals"; import { mocked } from "jest-mock"; import { SafeDrivesCollection_ } from "../../../../src/backend/utils/SafeDriveService/SafeDrivesCollection"; -import { - mockedDrive, - mockedDrivesCollection, -} from "../../../test-utils/gas-stubs"; +import { mockedDrive } from "../../../test-utils/gas-stubs"; test("SafeDrivesCollection constructs correctly", () => { - global.Drive = { - ...mockedDrive(), - Drives: mockedDrivesCollection(), - }; + global.Drive = mockedDrive(); expect(() => { new SafeDrivesCollection_(); @@ -32,7 +26,7 @@ test("list works", () => { ], }; - global.Drive.Drives = mockedDrivesCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Drives).list.mockReturnValueOnce(driveList); const drivesCollection = new SafeDrivesCollection_(); @@ -57,7 +51,7 @@ test("list works with optional parameters", () => { ], }; - global.Drive.Drives = mockedDrivesCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Drives).list.mockReturnValueOnce(driveList); const drivesCollection = new SafeDrivesCollection_(); @@ -98,7 +92,7 @@ test("list works with selective fields", () => { ], }; - global.Drive.Drives = mockedDrivesCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Drives) .list.mockReturnValueOnce(driveList1) .mockReturnValueOnce(driveList2); @@ -131,7 +125,7 @@ test("list throws an error on an invalid drive", () => { ], }; - global.Drive.Drives = mockedDrivesCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Drives).list.mockReturnValueOnce(driveList); const drivesCollection = new SafeDrivesCollection_(); @@ -143,7 +137,7 @@ test("list throws an error on an invalid drive", () => { }); test("list throws an error on an invalid drive list", () => { - global.Drive.Drives = mockedDrivesCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Drives).list.mockReturnValueOnce({}); const drivesCollection = new SafeDrivesCollection_(); diff --git a/__tests__/backend/utils/SafeDriveService/SafeFilesCollection.test.ts b/__tests__/backend/utils/SafeDriveService/SafeFilesCollection.test.ts index e9684235..2557321d 100644 --- a/__tests__/backend/utils/SafeDriveService/SafeFilesCollection.test.ts +++ b/__tests__/backend/utils/SafeDriveService/SafeFilesCollection.test.ts @@ -2,16 +2,10 @@ import { expect, test } from "@jest/globals"; import { mocked } from "jest-mock"; import { SafeFilesCollection_ } from "../../../../src/backend/utils/SafeDriveService/SafeFilesCollection"; -import { - mockedDrive, - mockedFilesCollection, -} from "../../../test-utils/gas-stubs"; +import { mockedDrive } from "../../../test-utils/gas-stubs"; test("SafeFilesCollection constructs correctly", () => { - global.Drive = { - ...mockedDrive(), - Files: mockedFilesCollection(), - }; + global.Drive = mockedDrive(); expect(() => { new SafeFilesCollection_(); @@ -29,7 +23,7 @@ test("copy works", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const copy = mocked(global.Drive.Files).copy.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -53,7 +47,7 @@ test("copy works with optional arguments", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const copy = mocked(global.Drive.Files).copy.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -76,7 +70,7 @@ test("copy works with selective fields", () => { mimeType: "text/plain", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const copy = mocked(global.Drive.Files).copy.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -109,7 +103,7 @@ test("copy throws and error on invalid file", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const copy = mocked(global.Drive.Files).copy.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -133,7 +127,7 @@ test("get works", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const get = mocked(global.Drive.Files).get.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -156,7 +150,7 @@ test("get works with optional arguments", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const get = mocked(global.Drive.Files).get.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -174,7 +168,7 @@ test("get works with selective fields", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const get = mocked(global.Drive.Files).get.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -196,7 +190,7 @@ test("get throws an error on invalid file", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const get = mocked(global.Drive.Files).get.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -219,7 +213,7 @@ test("create works", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const create = mocked(global.Drive.Files).create.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -243,7 +237,7 @@ test("create works with optional arguments", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const create = mocked(global.Drive.Files).create.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -266,7 +260,7 @@ test("create works with selective fields", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const create = mocked(global.Drive.Files).create.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -296,7 +290,7 @@ test("create throws an error on invalid file", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const create = mocked(global.Drive.Files).create.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -333,7 +327,7 @@ test("list works", () => { ], }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Files).list.mockReturnValueOnce(fileList); const filesCollection = new SafeFilesCollection_(); @@ -368,7 +362,7 @@ test("list works with optional arguments", () => { ], }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Files).list.mockReturnValueOnce(fileList); const filesCollection = new SafeFilesCollection_(); @@ -405,7 +399,7 @@ test("list works with selective fields", () => { ], }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Files).list.mockReturnValueOnce(fileList); const filesCollection = new SafeFilesCollection_(); @@ -444,7 +438,7 @@ test("list throws an error on invalid file", () => { ], }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Files).list.mockReturnValueOnce(fileList); const filesCollection = new SafeFilesCollection_(); @@ -458,7 +452,7 @@ test("list throws an error on invalid file", () => { test("list throws an error on invalid file list", () => { const fileList = {}; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const list = mocked(global.Drive.Files).list.mockReturnValueOnce(fileList); const filesCollection = new SafeFilesCollection_(); @@ -470,7 +464,7 @@ test("list throws an error on invalid file list", () => { }); test("remove works", () => { - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const remove = mocked(global.Drive.Files).remove.mockImplementationOnce( // eslint-disable-next-line @typescript-eslint/no-empty-function -- Implementation needed so the function is bound to local this () => {}, @@ -495,7 +489,7 @@ test("update works", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const update = mocked(global.Drive.Files).update.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -520,7 +514,7 @@ test("update works with optional arguments", () => { name: "FILE_TITLE", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const update = mocked(global.Drive.Files).update.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -549,7 +543,7 @@ test("update works with selective fields", () => { }, }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const update = mocked(global.Drive.Files).update.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); @@ -574,7 +568,7 @@ test("update throws an error on invalid file", () => { id: "FILE_ID", }; - global.Drive.Files = mockedFilesCollection(); + global.Drive = mockedDrive(); const update = mocked(global.Drive.Files).update.mockReturnValueOnce(file); const filesCollection = new SafeFilesCollection_(); diff --git a/__tests__/test-utils/gas-stubs.ts b/__tests__/test-utils/gas-stubs.ts index 46bc30dc..ee18bd53 100644 --- a/__tests__/test-utils/gas-stubs.ts +++ b/__tests__/test-utils/gas-stubs.ts @@ -2,40 +2,6 @@ import { jest } from "@jest/globals"; /* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any -- These are stubs for external functions */ -export function mockedCommentsCollection(): GoogleAppsScript.Drive_v3.Drive.V3.Collection.CommentsCollection { - return { - create: - jest.fn< - ( - resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Comment, - fileId: string, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Comment - >(), - get: jest.fn< - ( - fileId: string, - commentId: string, - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Comment - >(), - list: jest.fn< - ( - fileId: string, - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.CommentList - >(), - remove: jest.fn<(fileId: string, commentId: string) => void>(), - update: - jest.fn< - ( - resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Comment, - fileId: string, - commentId: string, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Comment - >(), - }; -} - export function mockedDrive(): GoogleAppsScript.Drive { return { About: mockedAboutCollection(), @@ -155,129 +121,6 @@ export function mockedDrive(): GoogleAppsScript.Drive { }; } -export function mockedDrivesCollection(): GoogleAppsScript.Drive_v3.Drive.V3.Collection.DrivesCollection { - return { - create: - jest.fn< - ( - resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive, - requestId: string, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive - >(), - get: jest.fn< - ( - driveId: string, - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive - >(), - hide: jest.fn< - (driveId: string) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive - >(), - list: jest.fn< - ( - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.DriveList - >(), - remove: - jest.fn<(driveId: string, optionalArgs?: Record) => void>(), - unhide: - jest.fn< - (driveId: string) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive - >(), - update: - jest.fn< - ( - resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive, - driveId: string, - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive - >(), - }; -} - -export function mockedFilesCollection(): GoogleAppsScript.Drive_v3.Drive.V3.Collection.FilesCollection { - return { - copy: jest.fn< - ( - resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File, - fileId: string, - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.File - >(), - create: - jest.fn< - ( - resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File, - mediaData?: GoogleAppsScript.Base.Blob, - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.File - >(), - download: - jest.fn< - ( - fileId: string, - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Operation - >(), - emptyTrash: jest.fn<(optionalArgs?: Record) => void>(), - export: jest.fn<(fileId: string, mimeType: string) => void>(), - generateIds: - jest.fn< - ( - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.GeneratedIds - >(), - get: jest.fn() as { - ( - fileId: string, - optionalArgs?: Record & { alt: "media" }, - ): string; - ( - fileId: string, - optionalArgs?: Record, - ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File; - }, - list: jest.fn< - ( - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.FileList - >(), - listLabels: - jest.fn< - ( - fileId: string, - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.LabelList - >(), - modifyLabels: - jest.fn< - ( - resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.ModifyLabelsRequest, - fileId: string, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.ModifyLabelsResponse - >(), - remove: - jest.fn<(fileId: string, optionalArgs?: Record) => void>(), - update: - jest.fn< - ( - resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File, - fileId: string, - mediaData?: GoogleAppsScript.Base.Blob, - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.File - >(), - watch: - jest.fn< - ( - resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Channel, - fileId: string, - optionalArgs?: Record, - ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Channel - >(), - }; -} - export function mockedHtmlOutput(): GoogleAppsScript.HTML.HtmlOutput { return { addMetaTag: @@ -611,6 +454,163 @@ function mockedChannelsCollection(): GoogleAppsScript.Drive_v3.Drive.V3.Collecti }; } +function mockedCommentsCollection(): GoogleAppsScript.Drive_v3.Drive.V3.Collection.CommentsCollection { + return { + create: + jest.fn< + ( + resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Comment, + fileId: string, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Comment + >(), + get: jest.fn< + ( + fileId: string, + commentId: string, + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Comment + >(), + list: jest.fn< + ( + fileId: string, + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.CommentList + >(), + remove: jest.fn<(fileId: string, commentId: string) => void>(), + update: + jest.fn< + ( + resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Comment, + fileId: string, + commentId: string, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Comment + >(), + }; +} + +function mockedDrivesCollection(): GoogleAppsScript.Drive_v3.Drive.V3.Collection.DrivesCollection { + return { + create: + jest.fn< + ( + resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive, + requestId: string, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive + >(), + get: jest.fn< + ( + driveId: string, + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive + >(), + hide: jest.fn< + (driveId: string) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive + >(), + list: jest.fn< + ( + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.DriveList + >(), + remove: + jest.fn<(driveId: string, optionalArgs?: Record) => void>(), + unhide: + jest.fn< + (driveId: string) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive + >(), + update: + jest.fn< + ( + resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive, + driveId: string, + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Drive + >(), + }; +} + +function mockedFilesCollection(): GoogleAppsScript.Drive_v3.Drive.V3.Collection.FilesCollection { + return { + copy: jest.fn< + ( + resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File, + fileId: string, + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.File + >(), + create: + jest.fn< + ( + resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File, + mediaData?: GoogleAppsScript.Base.Blob, + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.File + >(), + download: + jest.fn< + ( + fileId: string, + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Operation + >(), + emptyTrash: jest.fn<(optionalArgs?: Record) => void>(), + export: jest.fn<(fileId: string, mimeType: string) => void>(), + generateIds: + jest.fn< + ( + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.GeneratedIds + >(), + get: jest.fn() as { + ( + fileId: string, + optionalArgs?: Record & { alt: "media" }, + ): string; + ( + fileId: string, + optionalArgs?: Record, + ): GoogleAppsScript.Drive_v3.Drive.V3.Schema.File; + }, + list: jest.fn< + ( + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.FileList + >(), + listLabels: + jest.fn< + ( + fileId: string, + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.LabelList + >(), + modifyLabels: + jest.fn< + ( + resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.ModifyLabelsRequest, + fileId: string, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.ModifyLabelsResponse + >(), + remove: + jest.fn<(fileId: string, optionalArgs?: Record) => void>(), + update: + jest.fn< + ( + resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.File, + fileId: string, + mediaData?: GoogleAppsScript.Base.Blob, + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.File + >(), + watch: + jest.fn< + ( + resource: GoogleAppsScript.Drive_v3.Drive.V3.Schema.Channel, + fileId: string, + optionalArgs?: Record, + ) => GoogleAppsScript.Drive_v3.Drive.V3.Schema.Channel + >(), + }; +} + function mockedOperationCollection(): GoogleAppsScript.Drive_v3.Drive.V3.Collection.OperationCollection { return { cancel: jest.fn<(name: string) => void>(),