Supertest · Production Workflow และ Capstone
Debug Failing E2E
อ่าน failure output และ trace request flow เพื่อหาสาเหตุ
อ่าน failure จากนอกเข้าใน
เมื่อ E2E fail ให้เริ่มจาก status และ response ที่ caller เห็น จากนั้นตรวจ request input, app setup, logs, database state และ dependency ทีละชั้น วิธีนี้ช่วยแยก contract failure จาก infrastructure failure
debug response อย่างระวังTS
ใช้ข้อมูลที่ mask แล้วและลบ temporary logging หลังหาสาเหตุได้
failure checklist
ลำดับการไล่ปัญหาTEXT
ทำทีละข้อและหยุดเมื่อพบ failure ต้นเหตุ ไม่แก้หลายชั้นพร้อมกัน
i
ลด test ให้เล็กก่อน
ถ้า flow ยาว fail ให้รัน focused test ที่ reproduce branch เดียว เช่น invalid body หรือ missing id แล้วค่อยประกอบกลับ