Testing Strategies
Test Structure (Arrange-Act-Assert)
describe("OrderService", () => {
describe("createOrder", () => {
it("creates an order with valid items and returns order ID", async () => {
const repo = new InMemoryOrderRepository();
const service = new OrderService(repo);
const input = { customerId: "c1", items: [{ productId: "p1", quantity: 2 }] };
const result = await service.createOrder(input);
expect(result.id).toBeDefined();
[Description truncada. Veja o README completo no GitHub.]