使用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...