Some typecast cleanups

Summary: Some cleanup in typecasts

Reviewed By: jknoxville

Differential Revision: D22845467

fbshipit-source-id: 8a23a4800e2baf5e35bc1ac10095235fc8dc5894
This commit is contained in:
Michel Weststrate
2020-08-04 07:44:56 -07:00
committed by Facebook GitHub Bot
parent 7c6065889d
commit 14e6b1078d
2 changed files with 1 additions and 7 deletions

View File

@@ -571,9 +571,6 @@ test('PluginContainer can render Sandy device plugins', async () => {
Component: MySandyPlugin, 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( const {renderer, act, store, device} = await renderMockFlipperWithPlugin(
definition, definition,
); );

View File

@@ -159,8 +159,7 @@ test('requirePlugin loads plugin', () => {
version: '1.0.0', version: '1.0.0',
}); });
expect(plugin).not.toBeNull(); expect(plugin).not.toBeNull();
// @ts-ignore expect((plugin as any).prototype).toBeInstanceOf(FlipperPlugin);
expect(plugin!.prototype).toBeInstanceOf(FlipperPlugin);
expect(plugin!.id).toBe(TestPlugin.id); expect(plugin!.id).toBe(TestPlugin.id);
}); });
@@ -251,7 +250,6 @@ test('requirePlugin loads valid Sandy plugin', () => {
flipperSDKVersion: '0.0.0', flipperSDKVersion: '0.0.0',
}) as SandyPluginDefinition; }) as SandyPluginDefinition;
expect(plugin).not.toBeNull(); expect(plugin).not.toBeNull();
// @ts-ignore
expect(plugin).toBeInstanceOf(SandyPluginDefinition); expect(plugin).toBeInstanceOf(SandyPluginDefinition);
expect(plugin.id).toBe('Sample'); expect(plugin.id).toBe('Sample');
expect(plugin.details).toMatchObject({ expect(plugin.details).toMatchObject({
@@ -302,7 +300,6 @@ test('requirePlugin loads valid Sandy Device plugin', () => {
flipperSDKVersion: '0.0.0', flipperSDKVersion: '0.0.0',
}) as SandyPluginDefinition; }) as SandyPluginDefinition;
expect(plugin).not.toBeNull(); expect(plugin).not.toBeNull();
// @ts-ignore
expect(plugin).toBeInstanceOf(SandyPluginDefinition); expect(plugin).toBeInstanceOf(SandyPluginDefinition);
expect(plugin.id).toBe('Sample'); expect(plugin.id).toBe('Sample');
expect(plugin.details).toMatchObject({ expect(plugin.details).toMatchObject({