-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove endpoint-utils package (#8217)
<!-- Thank you for your contribution. Before making a PR, please read our contributing guidelines at https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution We recommend creating a *draft* PR, so that you can mark it as 'ready for review' when you are done. --> ## Purpose _Describe the problem you want to address or the feature you want to implement._ ## Approach _Describe how your changes address the issue or implement the desired functionality in as much detail as possible._ ## References closes #8207 ## Pre-Merge TODO - [ ] Write tests for your proposed changes - [ ] Make sure that existing tests do not fail --------- Co-authored-by: Bayheck <[email protected]> Co-authored-by: Popov Aleksey <[email protected]>
- Loading branch information
1 parent
4d0bc30
commit ff478f3
Showing
11 changed files
with
155 additions
and
106 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/browser/provider/built-in/dedicated/firefox/runtime-info.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,38 @@ | ||
import { GeneralError } from '../errors/runtime'; | ||
import { RUNTIME_ERRORS } from '../errors/types'; | ||
import endpointUtils from 'endpoint-utils'; | ||
import { | ||
isMyHostname, | ||
getIPAddress, | ||
isFreePort, | ||
getFreePort, | ||
} from '../utils/endpoint-utils'; | ||
|
||
export async function getValidHostname (hostname: string): Promise<string> { | ||
if (hostname) { | ||
const valid = await endpointUtils.isMyHostname(hostname); | ||
const valid = await isMyHostname(hostname); | ||
|
||
if (!valid) | ||
throw new GeneralError(RUNTIME_ERRORS.invalidHostname, hostname); | ||
} | ||
else | ||
hostname = endpointUtils.getIPAddress(); | ||
else { | ||
hostname = getIPAddress() ?? ''; | ||
|
||
if (!hostname) | ||
throw new GeneralError(RUNTIME_ERRORS.invalidHostname, hostname); | ||
} | ||
|
||
return hostname; | ||
} | ||
|
||
export async function getValidPort (port: number): Promise<number> { | ||
if (port) { | ||
const isFree = await endpointUtils.isFreePort(port); | ||
const isFree = await isFreePort(port); | ||
|
||
if (!isFree) | ||
throw new GeneralError(RUNTIME_ERRORS.portIsNotFree, port); | ||
} | ||
else | ||
port = await endpointUtils.getFreePort(); | ||
port = await getFreePort(); | ||
|
||
return port; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.