We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 184403a commit 156b26dCopy full SHA for 156b26d
src/test/proxy.ts
@@ -18,6 +18,16 @@ describe('ProxyConnect', () => {
18
let testSocket: Socket
19
let msgs: ProxyMessages
20
21
+ function doneOnce(done: Mocha.Done): Mocha.Done {
22
+ let fired = false;
23
+ return (err?: any) => {
24
+ if (!fired) {
25
+ fired = true
26
+ done(err);
27
+ }
28
29
30
+
31
beforeEach(() => {
32
testSocket = new Socket()
33
testSocket.connect = (...param): Socket => {
@@ -57,6 +67,7 @@ describe('ProxyConnect', () => {
57
67
})
58
68
59
69
it('should request registration', (done: Mocha.Done) => {
70
+ done = doneOnce(done)
60
71
conn.on('log_request', (str: string) => {
61
72
assert.equal(str, msgs.registerInfo)
62
73
done()
0 commit comments