summaryrefslogtreecommitdiff
path: root/js/net_test.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-04-21 16:40:10 -0400
committerGitHub <noreply@github.com>2019-04-21 16:40:10 -0400
commit9dfebbc9496138efbeedc431068f41662c780f3e (patch)
treec3718c3dc132d11c08c8fc18933daebf886bf787 /js/net_test.ts
parent6cded14bdf313762956d4d5361cfe8115628b535 (diff)
Fix eslint warnings (#2151)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com> Co-authored-by: LE GOFF Vincent <g_n_s@hotmail.fr>
Diffstat (limited to 'js/net_test.ts')
-rw-r--r--js/net_test.ts18
1 files changed, 10 insertions, 8 deletions
diff --git a/js/net_test.ts b/js/net_test.ts
index cb9a9163a..f02fa9611 100644
--- a/js/net_test.ts
+++ b/js/net_test.ts
@@ -1,12 +1,12 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { testPerm, assert, assertEquals } from "./test_util.ts";
-testPerm({ net: true }, function netListenClose() {
+testPerm({ net: true }, function netListenClose(): void {
const listener = Deno.listen("tcp", "127.0.0.1:4500");
listener.close();
});
-testPerm({ net: true }, async function netCloseWhileAccept() {
+testPerm({ net: true }, async function netCloseWhileAccept(): Promise<void> {
const listener = Deno.listen("tcp", ":4501");
const p = listener.accept();
listener.close();
@@ -21,7 +21,7 @@ testPerm({ net: true }, async function netCloseWhileAccept() {
assertEquals(err.message, "Listener has been closed");
});
-testPerm({ net: true }, async function netConcurrentAccept() {
+testPerm({ net: true }, async function netConcurrentAccept(): Promise<void> {
const listener = Deno.listen("tcp", ":4502");
let acceptErrCount = 0;
const checkErr = (e): void => {
@@ -42,12 +42,14 @@ testPerm({ net: true }, async function netConcurrentAccept() {
assertEquals(acceptErrCount, 1);
});
-testPerm({ net: true }, async function netDialListen() {
+testPerm({ net: true }, async function netDialListen(): Promise<void> {
const listener = Deno.listen("tcp", ":4500");
- listener.accept().then(async conn => {
- await conn.write(new Uint8Array([1, 2, 3]));
- conn.close();
- });
+ listener.accept().then(
+ async (conn): Promise<void> => {
+ await conn.write(new Uint8Array([1, 2, 3]));
+ conn.close();
+ }
+ );
const conn = await Deno.dial("tcp", "127.0.0.1:4500");
const buf = new Uint8Array(1024);
const readResult = await conn.read(buf);