mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-20 06:00:16 -06:00
* develop: fix: correct reference branch / commitSha in performance-reporter (#19941) test: Honeycomb system-test reporter (#19855) fix(deps): update dependency engine.io to v5.2.1 [security] feat: Retain fileName when working with aliased fixtures and files (#19820) Update release-process.md Update release-process.md Update release-process.md Update release-process.md Update release-process.md Update release-process.md Phrasing Updating release guide with findings from 9.3.0 release snafu add link to the video how to report Cypress bug
Socket
This is a shared lib for holding both the socket.io server and client.
Using
const socket = require("@packages/socket")
// returns
{
server: require("socket.io"),
getPathToClientSource: function () {
// returns path to the client 'socket.io.js' file
// for use in the browser
}
}
const socket = require("@packages/socket")
// server usage
const srv = require("http").createServer()
const io = socket.server(srv)
io.on("connection", function(){})
// client usage
const { client } = require("@packages/socket/lib/client")
const client = socket.client("http://localhost:2020")
client.on("connect", function(){})
client.on("event", function(){})
client.on("disconnect", function(){})
// path usage
socket.getPathToClientSource()
// returns your/path/to/node_modules/socket.io-client/socket.io.js0
Testing
yarn workspace @packages/socket test