Expose more meta information for plugins
Summary: expose `appName`, `appId` and `device` to Sandy plugins. Will be used in next diff to migrate navigation plugin Reviewed By: cekkaewnumchai Differential Revision: D24857253 fbshipit-source-id: 03ac3d376d5d1950bcf3d78386a65ce167b517e3
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9b4e7e873c
commit
1157976eef
@@ -180,7 +180,18 @@ export function startPlugin<Module extends FlipperPluginModule<any>>(
|
||||
|
||||
const sendStub = jest.fn();
|
||||
const flipperUtils = createMockFlipperLib();
|
||||
const testDevice = createMockDevice(options);
|
||||
const appName = 'TestApplication';
|
||||
const deviceName = 'TestDevice';
|
||||
const fakeFlipperClient: RealFlipperClient = {
|
||||
id: `${appName}#${testDevice.os}#${deviceName}#${testDevice.serial}`,
|
||||
query: {
|
||||
app: appName,
|
||||
device: deviceName,
|
||||
device_id: testDevice.serial,
|
||||
os: testDevice.serial,
|
||||
},
|
||||
deviceSync: testDevice,
|
||||
isBackgroundPlugin(_pluginId: string) {
|
||||
return !!options?.isBackgroundPlugin;
|
||||
},
|
||||
@@ -381,6 +392,7 @@ function createMockDevice(options?: StartPluginOptions): RealFlipperDevice {
|
||||
return {
|
||||
os: 'Android',
|
||||
deviceType: 'emulator',
|
||||
serial: 'serial-000',
|
||||
isArchived: !!options?.isArchived,
|
||||
addLogListener(cb) {
|
||||
logListeners.push(cb);
|
||||
|
||||
Reference in New Issue
Block a user