Writing Integration Tests
What architectural pattern is being tested in this code?
const mockQueue = new MockMessageQueue();
test('message processing integration', async () => {
await mockQueue.publish('orders', {
orderId: '123',
status: 'pending'
});
await waitForProcessing();
const order = await Order.findById('123');
expect(order.status).toBe('processed');
const notification = await Notification.findOne({
orderId: '123'
});
expect(notification).toBeDefined();
});