UNPKG

cq-websocket

Version:

A Node SDK for developing QQ chatbots based on WebSocket, which is depending on CoolQ and CQHTTP API plugin.

22 lines (17 loc) 402 B
const { stub } = require('sinon') const proxyquire = require('proxyquire').noCallThru() const FakeWebSocket = require('./FakeWebSocket') const fws = FakeWebSocket.getSeries() module.exports = function () { const wsStub = stub() wsStub.callsFake(fws) const CQWebsocket = proxyquire('../..', { websocket: { w3cwebsocket: wsStub } }) return { wsStub, CQWebsocket } }