Skip to content

Commit 94a2461

Browse files
committed
add error test for normal errors
1 parent a517f26 commit 94a2461

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/geocode.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,21 @@ describe("Geocode", function(){
8484
done();
8585
});
8686
});
87+
88+
it("should report errors", function(done){
89+
geoData = {
90+
addressLine1: "Bad adrress line 1",
91+
city: "City",
92+
stateCode: "State",
93+
zip: "ZipCode"
94+
}
95+
helper.nock().post("/accounts/FakeAccountId/geocodeRequest", helper.buildXml({requestAddress: geoData})).reply(400, {"Content-Type": "application/xml"});
96+
Geocode.request(helper.createClient(), geoData, function(err, geocode){
97+
if(err){
98+
return done();
99+
}
100+
done(new Error('An error is estimated'));
101+
});
102+
});
87103
});
88104
});

0 commit comments

Comments
 (0)