Skip to content

Commit

Permalink
revise and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 committed Oct 20, 2023
1 parent d3514ab commit e19bc48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/network.ts → src/network-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function findNetworkServiceOnMac() {
const serviceInfo = shell.exec(`${networkSetup} -getinfo "${service}"`, {async: false}).stdout;
for (const l of serviceInfo.split('\n')) {
if (l.includes('IP address') && !l.includes('IPv6') && !l.includes('none')) {
console.log(`Network service found: '${service}', IP address: ${l}`)
return service;
}
}
Expand All @@ -42,7 +41,6 @@ function findNetworkServiceOnMac() {

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setupMacProxy(proxy: any) {
console.log(`Setting system proxy settings: ${proxy.proxyHost}:${proxy.proxyPort}`);
const {
proxyHost,
proxyPort,
Expand Down Expand Up @@ -81,6 +79,7 @@ export function setupProxy() {
if (!proxy) {
return;
}
console.log(`Setting system proxy settings: ${proxy.proxyHost}:${proxy.proxyPort}`);
switch (process.platform) {
case 'darwin':
setupMacProxy(proxy);
Expand Down
2 changes: 1 addition & 1 deletion src/testcafe-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import {
setupProxy,
isProxyAvaliable,
} from './network';
} from './network-proxy';

async function prepareConfiguration(nodeBin: string, runCfgPath: string, suiteName: string) {
runCfgPath = getAbsolutePath(runCfgPath);
Expand Down

0 comments on commit e19bc48

Please sign in to comment.