
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
socket.io-mock-ts
Advanced tools
A mock to test the Socket.IO library implementation.
NEW! Added support for disconnect() and close()
yarn add socket.io-mock-ts
Create a new socket mock with:
import { SocketServerMock } from 'socket.io-mock-ts';
const socket = new SocketServerMock();
const client = socket.clientMock;
And use the socket as if it was a normal Socket.IO socket.
For example:
import { SocketServerMock } from 'socket.io-mock-ts';
import { expect, test } from 'vitest';
test('Sockets should be able to talk to each other without a server', () => {
const socket = new SocketServerMock();
socket.on('message', (message: string) => {
expect(message).toBe('Hello World!');
});
socket.clientMock.emit('message', 'Hello World!');
});
Or with using promises in unit tests, for example:
import { SocketServerMock } from 'socket.io-mock-ts';
import { expect, test } from 'vitest';
test('Sockets should be able to talk to each other without a server', () => {
const socket = new SocketServerMock();
const data = await new Promise((resolve) => {
socket.on('message', (message: string) => {
resolve(message);
});
socket.clientMock.emit('message', 'Hello World!');
});
expect(data).toBe('Hello World!');
});
FAQs
Mocked version of Socket.IO for testing
The npm package socket.io-mock-ts receives a total of 1,183 weekly downloads. As such, socket.io-mock-ts popularity was classified as popular.
We found that socket.io-mock-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.