How to mock a socket connection properly to simulate various on.('data' events

后端 未结 0 1517
梦如初夏
梦如初夏 2021-01-06 18:01

I\'m testing a method that returns a Promise based on the data filtered from a socket:

async readData(sConn) {
    if(!sConn) {
        throw new Error(\'READ         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题