Make plugin loading async
Summary: This diff makes plugin loading async, which we'd need in a browser env (either because we'd use `import()` or we need to fetch the source and than eval it), and deals with all the fallout of that Reviewed By: timur-valiev Differential Revision: D32669995 fbshipit-source-id: 73babf38a6757c451b8200c3b320409f127b8b5b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
64747dc417
commit
de59bbedd2
@@ -18,6 +18,7 @@ import {
|
||||
TestUtils,
|
||||
} from 'flipper-plugin';
|
||||
import {switchPlugin} from '../pluginManager';
|
||||
import {awaitPluginCommandQueueEmpty} from '../../dispatcher/pluginManager';
|
||||
|
||||
const pluginDetails = TestUtils.createMockPluginDetails();
|
||||
|
||||
@@ -184,6 +185,8 @@ test('it should not initialize a sandy plugin if not enabled', async () => {
|
||||
}),
|
||||
);
|
||||
|
||||
await awaitPluginCommandQueueEmpty(store);
|
||||
|
||||
expect(client.sandyPluginStates.get(Plugin2.id)).toBeUndefined();
|
||||
expect(instance.connectStub).toHaveBeenCalledTimes(0);
|
||||
// disconnect wasn't called because connect was never called
|
||||
|
||||
Reference in New Issue
Block a user