test: use as const to remove some usages of as any (#39475)

This commit is contained in:
David Sanders 2023-08-14 18:24:32 -07:00 committed by GitHub
parent 9eeef55469
commit effafdf498
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 17 deletions

View file

@ -1280,9 +1280,9 @@ describe('webContents module', () => {
'default_public_interface_only',
'default_public_and_private_interfaces',
'disable_non_proxied_udp'
];
] as const;
policies.forEach((policy) => {
w.webContents.setWebRTCIPHandlingPolicy(policy as any);
w.webContents.setWebRTCIPHandlingPolicy(policy);
expect(w.webContents.getWebRTCIPHandlingPolicy()).to.equal(policy);
});
});
@ -2254,7 +2254,7 @@ describe('webContents module', () => {
const promise = once(w.webContents, 'context-menu') as Promise<[any, Electron.ContextMenuParams]>;
// Simulate right-click to create context-menu event.
const opts = { x: 0, y: 0, button: 'right' as any };
const opts = { x: 0, y: 0, button: 'right' as const };
w.webContents.sendInputEvent({ ...opts, type: 'mouseDown' });
w.webContents.sendInputEvent({ ...opts, type: 'mouseUp' });