Added ability to override device paramters in Deviceplugin test utils
Summary: This allows for more controlled device plugin tests Reviewed By: mweststrate Differential Revision: D37609991 fbshipit-source-id: 7e0694ba97e6b2c34b5d9cd81761eecd2f50c6f9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e1e741b132
commit
4e2e23e3b4
@@ -62,6 +62,7 @@ interface StartPluginOptions {
|
|||||||
* Provide a set of GKs that are enabled in this test.
|
* Provide a set of GKs that are enabled in this test.
|
||||||
*/
|
*/
|
||||||
GKs?: string[];
|
GKs?: string[];
|
||||||
|
testDevice?: Device;
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExtractClientType<Module extends FlipperPluginModule<any>> = Parameters<
|
type ExtractClientType<Module extends FlipperPluginModule<any>> = Parameters<
|
||||||
@@ -587,6 +588,7 @@ function createMockDevice(options?: StartPluginOptions): Device & {
|
|||||||
},
|
},
|
||||||
deviceType: 'emulator',
|
deviceType: 'emulator',
|
||||||
serial: 'serial-000',
|
serial: 'serial-000',
|
||||||
|
...options?.testDevice,
|
||||||
isArchived: !!options?.isArchived,
|
isArchived: !!options?.isArchived,
|
||||||
connected: createState(true),
|
connected: createState(true),
|
||||||
addLogListener(cb) {
|
addLogListener(cb) {
|
||||||
|
|||||||
Reference in New Issue
Block a user