Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(expectedReplies: any) {
super();
this._replies = expectedReplies;
this._counter = 0;
this._mockTransport = new DirectTransport();
this._mockTransport.initialize(() => {
console.log("initialized");
});
this._mockTransport.server.on("data", (data: Buffer) => {
let reply = this._replies[this._counter];
this._counter++;
if (reply) {
if (_.isFunction(reply)) {
reply = reply.call(this);
// console.log(" interpreting reply as a function" + reply);
if (!reply) {
return;
}