Skip to content

Commit 23d6bdb

Browse files
committed
add an empty case
1 parent 716225e commit 23d6bdb

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/commands/types.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,15 @@ export interface GetConnectivityResult {
245245
/**
246246
* True if wifi is enabled
247247
*/
248-
wifi: boolean;
248+
wifi?: boolean;
249249
/**
250250
* True if mobile data connection is enabled
251251
*/
252-
data: boolean;
252+
data?: boolean;
253253
/**
254254
* True if Airplane Mode is enabled
255255
*/
256-
airplaneMode: boolean;
256+
airplaneMode?: boolean;
257257
}
258258

259259
export type ServiceType = 'wifi' | 'data' | 'airplaneMode';

test/unit/commands/network-specs.js

+3
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ describe('Network', function () {
128128
await driver.mobileGetConnectivity(['bad', 'array'])
129129
.should.eventually.rejectedWith(errors.InvalidArgumentError);
130130
});
131+
it('should raise unsupported services with an empty array', async function () {
132+
await driver.mobileGetConnectivity().should.eventually.eql({});
133+
});
131134
it('should return all supported services', async function () {
132135
adb.isWifiOn.returns(true);
133136
adb.isDataOn.returns(true);

0 commit comments

Comments
 (0)