Add validateAddress method#1
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Coverage Report for CI Build 25762347439Coverage remained the same at 100.0%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tightens the prior business test from !== 'RESIDENTIAL' to === 'BUSINESS' and adds explicit tests for MIXED, UNKNOWN, and a non-deliverable address that should return Resolved: false. MIXED uses 75 Spring St NY 10012 (SoHo apartments-over-retail) and UNKNOWN uses 1 Crow Heart Rd, Crowheart WY 82512 — both are best guesses; swap if FedEx classifies otherwise. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Integration tests against the FedEx sandbox can't pin classification
or attributes.Resolved — the sandbox stubs both to UNKNOWN / undefined.
Collapses the five integration classification tests to a single live
sanity check and adds five mocked tests, each inlining the exact
production response captured from apis.fedex.com:
- residential (5132 W Altgeld St, Chicago) -> classification: RESIDENTIAL, Resolved: 'true'
- business (1950 Parker Rd, Carrollton) -> classification: BUSINESS, Resolved: 'true'
- mixed (75 Spring St, NY) -> classification: MIXED, Resolved: 'true'
- unknown (1 Crow Heart Rd, Crowheart WY) -> classification: UNKNOWN, Resolved: 'true'
- unresolved (9999 Imaginary Way, Chicago) -> classification: UNKNOWN, Resolved: 'false'
Reveals a discrepancy with the fulfillment-service test fixture:
production returns attributes.Resolved as a STRING ('true'/'false'),
not a boolean. The fulfillment-service fixture has Resolved: true
(boolean); canShip's gate (Resolved !== false) never fires because
'false' !== false is always true.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Removes mockOAuthResponse, shipment, rateRequest, and the custom retry helper. Each test now inlines its own OAuth response and rate-request body, and async.retry replaces the bespoke retry function. MOCK_URL is gone too -- mocked tests no longer pass url:, so the FedEx default applies, and the mock fetch intercepts before any network call. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
async.retry treats a plain () => fn() as a callback-style task (with arity 0, so it never gets a callback to call back) and the returned Promise never resolves. Marking the arrow async makes async.retry detect it as promise-returning and wait on the result. This is what stalled the prior CI run for 18 minutes before being cancelled. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds CHANGELOG.md (modeled on @stores.com/http-error) covering 0.1.0 and 0.2.0. Reorders subtests within each test() block alphabetically to match the codebase convention. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
validateAddress(addressValidationRequest, options)method that calls FedEx Address Validation API (POST /address/v1/addresses/resolve)rateAndTransitTimes— caller supplies full request body, package forwards verbatimcustomer_transaction_idheader supportTest plan
validateAddressreturnsoutput.resolvedAddresses[]for valid addressHttpErrorerrors[]envelope throwsHttpErrorcustomer_transaction_idoption sent asx-customer-transaction-idheader🤖 Generated with Claude Code