Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa committed Nov 22, 2023
1 parent 4742955 commit 5ecacde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion driver/lib/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type {
RouteMatcher
} from '@appium/types';
import type { IsolateSocket } from './sessions/isolate_socket';
import type { Server } from 'rpc-websockets';
import type { Server } from 'node:net';


type FluttertDriverConstraints = typeof desiredCapConstraints;
Expand Down
8 changes: 4 additions & 4 deletions driver/lib/sessions/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ export const getObservatoryWsUri = async (
remoteSocket.pipe(localSocket);
});
const listeningPromise = new B((resolve, reject) => {
flutterDriver.localServer.once(`listening`, resolve);
flutterDriver.localServer.once(`error`, reject);
flutterDriver.localServer?.once(`listening`, resolve);
flutterDriver.localServer?.once(`error`, reject);
});
flutterDriver.localServer.listen(localPort);
flutterDriver.localServer?.listen(localPort);
try {
await listeningPromise;
} catch (e) {
Expand All @@ -117,7 +117,7 @@ export const getObservatoryWsUri = async (
log.info(`Forwarding the remote port ${remotePort} to the local port ${localPort}`);

process.on(`beforeExit`, () => {
flutterDriver.localServer.close();
flutterDriver.localServer?.close();
});
return urlObject.toJSON();
};

0 comments on commit 5ecacde

Please sign in to comment.