Testing
Load skill: mocking
Interface Testing
Good interfaces make testing natural:
-
Accept dependencies, don't create them
// Testable function processOrder(order, paymentGateway) {} // Hard to test function processOrder(order) { const gateway = new StripeGateway(); } -
Return results, don't produce side effects
// Testable function calculateDiscount(cart): Discount {} // Hard to test
[Description truncada. Veja o README completo no GitHub.]