节点中的web套接字的单元测试是否可能?

时间:2016-08-01 09:21:45

标签: javascript node.js unit-testing websocket

使用mocha / supertest / chai运行单元测试我想测试以下代码,所以我的问题应该如何模拟升级事件?

const http = require('http');
const app = require('./app');
const server = http.createServer(app);

var webSocket = function (server) {
    server.on('upgrade', function (req, socket, head) {
    //I want to enter here...

0 个答案:

没有答案