diff --git a/test/README.md b/test/README.md index 1c85a5f..bd8e83b 100644 --- a/test/README.md +++ b/test/README.md @@ -119,6 +119,27 @@ const res = await GET(req, { params: { id: 'prod-123' } }) La soglia minima configurata in `vitest.config.ts` è **70% di linee e funzioni**. Il comando `npm run test:coverage` fallisce se non viene rispettata. La copertura attuale è circa **11% di linee e 33% di funzioni** — la soglia va abbassata temporaneamente o la suite va estesa. +### Output atteso durante l'esecuzione + +Durante `npm test` o `npm run test:coverage` possono comparire righe che sembrano errori ma sono normali: + +``` +stderr | ...stripe.test.ts > returns 400 when signature verification fails +Webhook signature verification failed: stripe_signature_mismatch +``` +La route `/api/webhooks/stripe` logga intenzionalmente il messaggio quando la firma è invalida. Il test verifica proprio questo scenario — il `stderr` è corretto. + +``` +stdout | ...stripe.test.ts > returns 200 for unhandled event types +Unhandled event type: customer.created +``` +Anche questo è il log della route per eventi Stripe non gestiti. Comportamento atteso. + +``` +The CJS build of Vite's Node API is deprecated. +``` +Warning di Vitest 1.x, innocuo. Sparirà aggiornando a Vitest 2+. + ### Cosa manca (per priorità) #### Alta priorità — logica di business critica