Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated GAS types #1863

Merged
merged 3 commits into from
Dec 26, 2024
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
5 changes: 1 addition & 4 deletions __tests__/backend/utils/DriveBackedValue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,7 @@ test("DriveBackedValue loads a value - the folder exists, the value exists", ()
],
};
const driveServiceMock = mockedSafeDriveService();
driveServiceMock.Files.get.mockReturnValueOnce(
// Incorrect upstream typings, string is actually permissible
JSON.stringify("VALUE") as unknown as GoogleAppsScript.Drive.Schema.File,
);
driveServiceMock.Files.get.mockReturnValueOnce(JSON.stringify("VALUE"));
driveServiceMock.Files.list
.mockReturnValueOnce(response1)
.mockReturnValueOnce(response2);
Expand Down
13 changes: 12 additions & 1 deletion __tests__/test-utils/gas-stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,18 @@ export function mockedFilesCollection(): GoogleAppsScript.Drive.Collection.Files
emptyTrash: jest.fn<() => void>(),
export: jest.fn<(fileId: string, mimeType: string) => void>(),
generateIds: jest.fn<() => GoogleAppsScript.Drive.Schema.GeneratedIds>(),
get: jest.fn<(fileId: string) => GoogleAppsScript.Drive.Schema.File>(),
get: jest.fn() as {
(
fileId: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- From upstream types
optionalArgs?: Record<string, any> & { alt: "media" },
): string;
(
fileId: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- From upstream types
optionalArgs?: Record<string, any>,
): GoogleAppsScript.Drive.Schema.File;
},
insert:
jest.fn<
(
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@smui/linear-progress": "^7.0.0",
"@smui/list": "^7.0.0",
"@smui/top-app-bar": "^7.0.0",
"@types/google-apps-script": "^1.0.86",
"@types/google-apps-script": "^1.0.89",
"@types/google.script.client-side": "^0.1.5",
"@types/jest": "^29.5.14",
"@types/node": "^22.9.3",
Expand Down
Loading