Skip to content

Commit

Permalink
Adding common.mustCall over callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
juggernaut451 committed Feb 11, 2018
1 parent a5bff1f commit 762231d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-tls-pause.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ const bufSize = 1024 * 1024;
let sent = 0;
let received = 0;

const server = tls.Server(options, (socket) => {
const server = tls.Server(options, common.mustCall((socket) => {
socket.pipe(socket);
socket.on('data', (c) => {
console.error('data', c.length);
});
});
}));

server.listen(0, () => {
let resumed = false;
const client = tls.connect({
port: server.address().port,
rejectUnauthorized: false
}, () => {
}, common.mustCall(() => {
console.error('connected');
client.pause();
console.error('paused');
let send = (() => {
const send = (() => {
console.error('sending');
const ret = client.write(Buffer.allocUnsafe(bufSize));
console.error(`write => ${ret}`);
Expand All @@ -72,7 +72,7 @@ server.listen(0, () => {
client.resume();
console.error('resumed', client);
})();
});
}));
client.on('data', (data) => {
console.error('data');
assert.ok(resumed);
Expand Down

0 comments on commit 762231d

Please sign in to comment.