update
This commit is contained in:
@ -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');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user