diff options
Diffstat (limited to 'cli/tests/complex_permissions_test.ts')
-rw-r--r-- | cli/tests/complex_permissions_test.ts | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/cli/tests/complex_permissions_test.ts b/cli/tests/complex_permissions_test.ts index f4b8e6c73..ad8b5302c 100644 --- a/cli/tests/complex_permissions_test.ts +++ b/cli/tests/complex_permissions_test.ts @@ -14,11 +14,7 @@ const test: { [key: string]: Function } = { }, netListen(endpoints: string[]): void { endpoints.forEach((endpoint) => { - const index = endpoint.lastIndexOf(":"); - const [hostname, port] = [ - endpoint.substr(0, index), - endpoint.substr(index + 1), - ]; + const [hostname, port] = endpoint.split(":"); const listener = Deno.listen({ transport: "tcp", hostname, @@ -29,11 +25,7 @@ const test: { [key: string]: Function } = { }, async netConnect(endpoints: string[]): Promise<void> { for (const endpoint of endpoints) { - const index = endpoint.lastIndexOf(":"); - const [hostname, port] = [ - endpoint.substr(0, index), - endpoint.substr(index + 1), - ]; + const [hostname, port] = endpoint.split(":"); const listener = await Deno.connect({ transport: "tcp", hostname, |