This commit is contained in:
2025-05-29 01:00:20 +00:00
parent 2024ea5a69
commit d8d1bdcd41
14 changed files with 190 additions and 791 deletions

View File

@ -15,7 +15,7 @@ tap.test('setup socket handler test', async () => {
},
action: {
type: 'socket-handler',
socketHandler: (socket) => {
socketHandler: (socket, context) => {
console.log('Socket handler called');
// Simple echo server
socket.write('ECHO SERVER\n');
@ -81,7 +81,7 @@ tap.test('should handle async socket handler', async () => {
match: { ports: 9999 },
action: {
type: 'socket-handler',
socketHandler: async (socket) => {
socketHandler: async (socket, context) => {
// Set up data handler first
socket.on('data', async (data) => {
console.log('Async handler received:', data.toString());
@ -134,7 +134,7 @@ tap.test('should handle errors in socket handler', async () => {
match: { ports: 9999 },
action: {
type: 'socket-handler',
socketHandler: (socket) => {
socketHandler: (socket, context) => {
throw new Error('Handler error');
}
}