Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use process.platform instead #574

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/remote/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,23 @@ const {
defaults,
event: { emit },
} = require('@faltest/utils');
const os = require('os');
// const config = require('config');

// We aren't using `@wdio/cli` (wdio testrunner)
process.env.SUPPRESS_NO_CONFIG_WARNING = 'true';

const platform = os.platform();

const ChromeDriverName = 'chromedriver';
const FirefoxDriverName = 'geckodriver';

let port;

const webDriverRegex = /^(chromedriver(?:\.exe)?|geckodriver(?:\.exe)?)$/;
const browserNameRegex = (() => {
switch (platform) {
switch (process.platform) {
case 'linux': return /^(chrome|firefox)$/;
case 'darwin': return /^(Google Chrome|firefox-bin)$/;
case 'win32': return /^(chrome\.exe|firefox\.exe)$/;
default: throw new Error(`Platform "${platform}" not supported`);
default: throw new Error(`Platform "${process.platform}" not supported`);
}
})();
const browserCmdRegex = (() => {
Expand Down