smartystreets-javascript-sdk
Advanced tools
Comparing version 1.1.0 to 1.1.2
{ | ||
"name": "smartystreets-javascript-sdk", | ||
"version": "1.1.0", | ||
"version": "1.1.2", | ||
"description": "Quick and easy SmartyStreets address validation.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -50,2 +50,4 @@ const Errors = require("../Errors"); | ||
function buildSuggestionsFromResponse(payload) { | ||
if (payload.suggestions === null) return []; | ||
return payload.suggestions.map(suggestion => new Suggestion(suggestion)); | ||
@@ -52,0 +54,0 @@ } |
@@ -78,2 +78,14 @@ const chai = require("chai"); | ||
it("returns an empty array when no suggestions are returned.", () => { | ||
let mockExpectedPayload = {suggestions: null}; | ||
let mockSender = new MockSenderWithResponse(mockExpectedPayload); | ||
let client = new Client(mockSender); | ||
let lookup = new Lookup("Please let this be easy to test."); | ||
let expectedSuggestion = []; | ||
return client.send(lookup).then(response => { | ||
expect(lookup.result).to.deep.equal(expectedSuggestion); | ||
}); | ||
}); | ||
it("attaches suggestions from a response to a lookup.", function () { | ||
@@ -80,0 +92,0 @@ const responseData = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119387
2738