Skip to content

Commit 27601b2

Browse files
committed
test: convert monitor tests to TypeScript
1 parent c7de157 commit 27601b2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/unit/compat/socket-monitor-test.js renamed to test/unit/compat/socket-monitor-test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
if (process.env.INCLUDE_COMPAT_TESTS) {
2-
const zmq = require("./load")
3-
const semver = require("semver")
4-
const {assert} = require("chai")
5-
const {testProtos, uniqAddress} = require("../helpers")
6-
const {isFullError} = require("../../src/errors")
1+
import * as zmq from "../../../v5-compat"
2+
import semver from "semver"
3+
import {assert} from "chai"
4+
import {testProtos, uniqAddress} from "../helpers"
5+
import {isFullError} from "../../../src/errors"
76

7+
if (process.env.INCLUDE_COMPAT_TESTS) {
88
/* This test case only seems to work reliably with TCP. */
99
for (const proto of testProtos("tcp")) {
1010
describe(`compat socket with ${proto} monitor`, function () {
@@ -24,11 +24,11 @@ if (process.env.INCLUDE_COMPAT_TESTS) {
2424
}
2525
})
2626

27-
it("should be able to monitor the socket", function (done) {
27+
it("should be able to monitor the socket", async function (done) {
2828
const rep = zmq.socket("rep")
2929
const req = zmq.socket("req")
3030

31-
const address = uniqAddress(proto)
31+
const address = await uniqAddress(proto)
3232

3333
rep.on("message", function (msg) {
3434
assert.instanceOf(msg, Buffer)

0 commit comments

Comments
 (0)