Commit 4ae3fb0
committed
test: add high-priority tests for polling and certificate upload
- Add comprehensive tests for NfeClient.pollUntilComplete() (19 tests)
* Test successful polling with multiple attempts
* Test URL path extraction from full URLs and relative paths
* Test timeout handling and error detection
* Test recovery from temporary network errors
* Test polling options validation
- Add createAndWait() tests to ServiceInvoicesResource (15 tests)
* Test synchronous response (201) without polling
* Test async response (202) with automatic polling
* Test polling timeout and processing failures
* Test custom polling options
* Add getStatus() and createBatch() tests
- Add uploadCertificate() tests to CompaniesResource (15 tests)
* Test certificate upload with Buffer and password
* Test FormData creation and usage
* Test custom filename handling
* Test error propagation
* Add getCertificateStatus(), findByTaxNumber(), and batch tests
- Add client-polling integration tests (12 tests)
* Test end-to-end invoice creation workflow
* Test progressive status changes
* Test network error recovery during polling
* Test concurrent invoice creation
* Test real-world NFE.io scenarios
Coverage: ~50 new tests covering critical business logic
Status: 78 passing / 79 total (98.7%)
Impact: Eliminates critical gaps in polling and certificate upload1 parent 7ed6f98 commit 4ae3fb0
File tree
4 files changed
+1699
-0
lines changed- tests/unit
4 files changed
+1699
-0
lines changed
0 commit comments