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
@@ -292,20 +292,20 @@ test('log listeners are resumed and suspended automatically - 2', async () => {
|
||||
expect(entries.length).toBe(2);
|
||||
|
||||
// disable one plugin
|
||||
flipper.togglePlugin(Plugin.id);
|
||||
await flipper.togglePlugin(Plugin.id);
|
||||
expect(device.stopLogging).toBeCalledTimes(0);
|
||||
device.addLogEntry(message);
|
||||
expect(entries.length).toBe(3);
|
||||
|
||||
// disable the other plugin
|
||||
flipper.togglePlugin(DevicePlugin.id);
|
||||
await flipper.togglePlugin(DevicePlugin.id);
|
||||
|
||||
expect(device.stopLogging).toBeCalledTimes(1);
|
||||
device.addLogEntry(message);
|
||||
expect(entries.length).toBe(3);
|
||||
|
||||
// re-enable plugn
|
||||
flipper.togglePlugin(Plugin.id);
|
||||
await flipper.togglePlugin(Plugin.id);
|
||||
expect(device.startLogging).toBeCalledTimes(2);
|
||||
device.addLogEntry(message);
|
||||
expect(entries.length).toBe(4);
|
||||
|
||||
Reference in New Issue
Block a user