Skip to content

Commit dd3c611

Browse files
committed
test: fix double bind failure check test
1 parent c123acf commit dd3c611

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.mocharc.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
"use strict"
2-
3-
module.exports = {
1+
/**
2+
* @type {import('mocha').MochaOptions}
3+
*/
4+
const config = {
45
require: ["ts-node/register", "rocha"],
56
spec: [
67
"test/unit/*-test.ts",
@@ -13,3 +14,5 @@ module.exports = {
1314
exit: true,
1415
parallel: true,
1516
}
17+
18+
module.exports = config

test/unit/socket-bind-unbind-test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) {
7272
it("should fail during other bind", async function () {
7373
let promise
7474
try {
75-
promise = sock.bind(await uniqAddress(proto))
76-
await sock.bind(await uniqAddress(proto))
75+
const address = await uniqAddress(proto)
76+
const address2 = await uniqAddress(proto)
77+
78+
promise = sock.bind(address)
79+
await sock.bind(address2)
7780
assert.ok(false)
7881
} catch (err) {
7982
if (!isFullError(err)) {

0 commit comments

Comments
 (0)