mirror of
https://github.com/appium/appium.git
synced 2026-10-28 20:31:51 +08:00
- all tests changed were needed because of path issues. I was unable to get the tests working in their entirety _without_ adding `@appium/fake-driver` to the monorepo--it would have required a separate `npm install` step in `appium-fake-driver` due to the lack of its `devDependencies` and `prepare` script--so I figured I might as well pull it in now. - deduped `package.json` scripts somewhat - updated ESLint configuration to include `@appium/fake-driver`'s rule override - sorted the root `package.json` because fussy - added `wd` as a dev dep because `@appium/fake-driver` needs it
30 lines
717 B
JavaScript
Executable File
30 lines
717 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
// transpile:main
|
|
|
|
import { asyncify } from 'asyncbox';
|
|
import * as driver from './lib/driver';
|
|
import * as server from './lib/server';
|
|
|
|
|
|
const { FakeDriver } = driver;
|
|
const { startServer } = server;
|
|
|
|
const DEFAULT_HOST = 'localhost';
|
|
const DEFAULT_PORT = 4774;
|
|
|
|
async function main () {
|
|
const getArgValue = (argName) => {
|
|
const argIndex = process.argv.indexOf(argName);
|
|
return argIndex > 0 ? process.argv[argIndex + 1] : null;
|
|
};
|
|
const port = parseInt(getArgValue('--port'), 10) || DEFAULT_PORT;
|
|
const host = getArgValue('--host') || DEFAULT_HOST;
|
|
return await startServer(port, host);
|
|
}
|
|
|
|
if (require.main === module) {
|
|
asyncify(main);
|
|
}
|
|
|
|
export { FakeDriver, startServer };
|