Comply with noImplicitAny (#9940)

* Stash noImplicitAny work

* Stash

* Fix imports

* Iterate

* Fix tests

* Delint

* Fix tests
This commit is contained in:
Michael Telatynski 2023-02-13 11:39:16 +00:00 committed by GitHub
parent ac7f69216e
commit 61a63e47f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
359 changed files with 1621 additions and 1353 deletions

View file

@ -46,7 +46,7 @@ describe("RolesRoomSettingsTab", () => {
});
describe("Element Call", () => {
const mockPowerLevels = (events): void => {
const mockPowerLevels = (events: Record<string, number>): void => {
jest.spyOn(room.currentState, "getStateEvents").mockReturnValue({
getContent: () => ({
events,

View file

@ -24,7 +24,7 @@ import { mockPlatformPeg } from "../../../../../test-utils/platform";
const PATH_TO_KEYBOARD_SHORTCUTS = "../../../../../../src/accessibility/KeyboardShortcuts";
const PATH_TO_KEYBOARD_SHORTCUT_UTILS = "../../../../../../src/accessibility/KeyboardShortcutUtils";
const mockKeyboardShortcuts = (override) => {
const mockKeyboardShortcuts = (override: Record<string, any>) => {
jest.doMock(PATH_TO_KEYBOARD_SHORTCUTS, () => {
const original = jest.requireActual(PATH_TO_KEYBOARD_SHORTCUTS);
return {
@ -34,7 +34,7 @@ const mockKeyboardShortcuts = (override) => {
});
};
const mockKeyboardShortcutUtils = (override) => {
const mockKeyboardShortcutUtils = (override: Record<string, any>) => {
jest.doMock(PATH_TO_KEYBOARD_SHORTCUT_UTILS, () => {
const original = jest.requireActual(PATH_TO_KEYBOARD_SHORTCUT_UTILS);
return {
@ -68,7 +68,7 @@ describe("KeyboardUserSettingsTab", () => {
},
});
mockKeyboardShortcutUtils({
getKeyboardShortcutValue: (name) => {
getKeyboardShortcutValue: (name: string) => {
switch (name) {
case "keybind1":
return {
@ -88,7 +88,7 @@ describe("KeyboardUserSettingsTab", () => {
}
}
},
getKeyboardShortcutDisplayName: (name) => {
getKeyboardShortcutDisplayName: (name: string) => {
switch (name) {
case "keybind1":
return "Cancel replying to a message";

View file

@ -927,7 +927,7 @@ describe("<SessionManagerTab />", () => {
// get a handle for resolving the delete call
// because promise flushing after the confirm modal is resolving this too
// and we want to test the loading state here
let resolveDeleteRequest;
let resolveDeleteRequest: (v?: IAuthData) => void;
mockClient.deleteMultipleDevices.mockImplementation(() => {
const promise = new Promise<IAuthData>((resolve) => {
resolveDeleteRequest = resolve;