Writing Integration Tests
What type of integration is being tested here?
test('real-time updates', async () => {
const wsClient = new WebSocket('ws://localhost:3000');
const connected = await waitForSocketConnection(wsClient);
expect(connected).toBe(true);
const dataPromise = waitForSocketData(wsClient);
await triggerUpdate();
const receivedData = await dataPromise;
expect(receivedData).toMatchObject({
type: 'update',
data: expect.any(Object)
});
});