1+ const addresses = [
2+ {
3+ id : 1 ,
4+ street : '123 Satellite Blvd' ,
5+ city : 'Space City' ,
6+ state : 'TX' ,
7+ zip : '12345' ,
8+ type : 'satellite'
9+ } ,
10+ {
11+ id : 2 ,
12+ street : '456 Non-Residential Rd' ,
13+ city : 'Business Town' ,
14+ state : 'CA' ,
15+ zip : '67890' ,
16+ type : 'non-residential'
17+ } ,
18+ {
19+ id : 3 ,
20+ street : '789 PO Box' ,
21+ city : 'Mailville' ,
22+ state : 'NY' ,
23+ zip : '10112' ,
24+ type : 'PO Box'
25+ }
26+ ] ;
27+
28+ // Edge cases for address verification tests
29+ const addressEdgeCases = [
30+ {
31+ type : 'residential_house' ,
32+ input : { line1 : 'residential house' , zip : '11111' } ,
33+ expected : {
34+ deliverable : true ,
35+ warning : null ,
36+ revisedAddress : {
37+ line1 : '1709 BRODERICK ST' ,
38+ line2 : null ,
39+ city : 'SAN FRANCISCO' ,
40+ state : 'CA' ,
41+ zip : '94115-2525'
42+ }
43+ }
44+ } ,
45+ {
46+ type : 'residential_highrise' ,
47+ input : { line1 : 'residential highrise' , zip : '11111' } ,
48+ expected : {
49+ deliverable : true ,
50+ revisedAddress : {
51+ city : 'SAN FRANCISCO' ,
52+ line1 : '660 KING ST UNIT 305' ,
53+ line2 : null ,
54+ state : 'CA' ,
55+ zip : '94107-1539'
56+ } ,
57+ warning : null
58+ }
59+ } ,
60+ {
61+ type : 'department_of_state' ,
62+ input : { line1 : 'department of state' , zip : '11111' } ,
63+ expected : {
64+ deliverable : true ,
65+ revisedAddress : {
66+ city : 'DPO' ,
67+ line1 : 'UNIT 8900 BOX 4301' ,
68+ line2 : null ,
69+ state : 'AE' ,
70+ zip : '09831-4301'
71+ } ,
72+ warning : null
73+ }
74+ } ,
75+ {
76+ type : 'military' ,
77+ input : { line1 : 'military' , zip : '11111' } ,
78+ expected : {
79+ deliverable : true ,
80+ revisedAddress : {
81+ city : 'APO' ,
82+ line1 : 'CMR 409 BOX 145' ,
83+ line2 : null ,
84+ state : 'AE' ,
85+ zip : '09053-0002'
86+ } ,
87+ warning : null
88+ }
89+ } ,
90+ {
91+ type : 'unnecessary_unit' ,
92+ input : { line1 : 'unnecessary unit' , zip : '11111' } ,
93+ expected : {
94+ deliverable : true ,
95+ revisedAddress : {
96+ city : 'SAN FRANCISCO' ,
97+ line1 : '1709 BRODERICK ST APT 505' ,
98+ line2 : null ,
99+ state : 'CA' ,
100+ zip : '94115-2525'
101+ } ,
102+ warning : 'Address may be deliverable but contains an unnecessary suite number'
103+ }
104+ } ,
105+ {
106+ type : 'po_box' ,
107+ input : { line1 : 'po box' , zip : '11111' } ,
108+ expected : {
109+ error : 'Post office boxes are not currently supported'
110+ }
111+ } ,
112+ {
113+ type : 'puerto_rico' ,
114+ input : { line1 : 'puerto rico' , zip : '11111' } ,
115+ expected : {
116+ error : 'Puerto Rico addresses are not currently supported'
117+ }
118+ } ,
119+ {
120+ type : 'commercial_building' ,
121+ input : { line1 : 'deliverable' , zip : '11111' } ,
122+ expected : {
123+ error : 'Non-residential addresses are not currently supported'
124+ }
125+ } ,
126+ {
127+ type : 'commercial_highrise' ,
128+ input : { line1 : 'commercial highrise' , zip : '11111' } ,
129+ expected : {
130+ error : 'Non-residential addresses are not currently supported'
131+ }
132+ } ,
133+ {
134+ type : 'undeliverable' ,
135+ input : { line1 : 'undeliverable block match' , zip : '11111' } ,
136+ expected : {
137+ error : 'Address is undeliverable'
138+ }
139+ }
140+ ] ;
141+
142+ module . exports = { addresses, addressEdgeCases } ;
0 commit comments