fix: DatagramConn.send should return bytes sent (#6265)

This commit is contained in:
Kermit Xuan 2020-06-13 22:14:31 +08:00 committed by GitHub
parent f6fa659384
commit 77545219a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 15 deletions

View file

@ -240,7 +240,9 @@ unitTest(
assertEquals(bob.addr.hostname, "127.0.0.1");
const sent = new Uint8Array([1, 2, 3]);
await alice.send(sent, bob.addr);
const byteLength = await alice.send(sent, bob.addr);
assertEquals(byteLength, 3);
const [recvd, remote] = await bob.receive();
assert(remote.transport === "udp");