From 14e6b1078dad1dbc7f6b74a021adce1104ea5c24 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Tue, 4 Aug 2020 07:44:56 -0700 Subject: [PATCH] Some typecast cleanups Summary: Some cleanup in typecasts Reviewed By: jknoxville Differential Revision: D22845467 fbshipit-source-id: 8a23a4800e2baf5e35bc1ac10095235fc8dc5894 --- desktop/app/src/__tests__/PluginContainer.node.tsx | 3 --- desktop/app/src/dispatcher/__tests__/plugins.node.tsx | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/desktop/app/src/__tests__/PluginContainer.node.tsx b/desktop/app/src/__tests__/PluginContainer.node.tsx index e139838e2..01305e033 100644 --- a/desktop/app/src/__tests__/PluginContainer.node.tsx +++ b/desktop/app/src/__tests__/PluginContainer.node.tsx @@ -571,9 +571,6 @@ test('PluginContainer can render Sandy device plugins', async () => { Component: MySandyPlugin, }, ); - // any cast because this plugin is not enriched with the meta data that the plugin loader - // normally adds. Our further sandy plugin test infra won't need this, but - // for this test we do need to act a s a loaded plugin, to make sure PluginContainer itself can handle it const {renderer, act, store, device} = await renderMockFlipperWithPlugin( definition, ); diff --git a/desktop/app/src/dispatcher/__tests__/plugins.node.tsx b/desktop/app/src/dispatcher/__tests__/plugins.node.tsx index 6ca8795a8..330183a06 100644 --- a/desktop/app/src/dispatcher/__tests__/plugins.node.tsx +++ b/desktop/app/src/dispatcher/__tests__/plugins.node.tsx @@ -159,8 +159,7 @@ test('requirePlugin loads plugin', () => { version: '1.0.0', }); expect(plugin).not.toBeNull(); - // @ts-ignore - expect(plugin!.prototype).toBeInstanceOf(FlipperPlugin); + expect((plugin as any).prototype).toBeInstanceOf(FlipperPlugin); expect(plugin!.id).toBe(TestPlugin.id); }); @@ -251,7 +250,6 @@ test('requirePlugin loads valid Sandy plugin', () => { flipperSDKVersion: '0.0.0', }) as SandyPluginDefinition; expect(plugin).not.toBeNull(); - // @ts-ignore expect(plugin).toBeInstanceOf(SandyPluginDefinition); expect(plugin.id).toBe('Sample'); expect(plugin.details).toMatchObject({ @@ -302,7 +300,6 @@ test('requirePlugin loads valid Sandy Device plugin', () => { flipperSDKVersion: '0.0.0', }) as SandyPluginDefinition; expect(plugin).not.toBeNull(); - // @ts-ignore expect(plugin).toBeInstanceOf(SandyPluginDefinition); expect(plugin.id).toBe('Sample'); expect(plugin.details).toMatchObject({