smartystreets-javascript-sdk
Advanced tools
Comparing version 1.10.5 to 1.10.6
{ | ||
"name": "smartystreets-javascript-sdk", | ||
"version": "1.10.5", | ||
"version": "1.10.6", | ||
"description": "Quick and easy SmartyStreets address validation.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
class Lookup { | ||
constructor(search, country = "United States") { | ||
constructor(search = "", country = "United States", include_only_administrative_area = "", include_only_locality = "", include_only_postal_code = "") { | ||
this.result = []; | ||
@@ -7,2 +7,5 @@ | ||
this.country = country; | ||
this.include_only_administrative_area = include_only_administrative_area; | ||
this.include_only_locality = include_only_locality; | ||
this.include_only_postal_code = include_only_postal_code; | ||
} | ||
@@ -9,0 +12,0 @@ } |
@@ -23,2 +23,29 @@ const chai = require("chai"); | ||
}); | ||
it("Set include only administrative area param", function () { | ||
const administrativeArea = "administrative area"; | ||
const expectedPrefix = "z"; | ||
let lookup = new Lookup(expectedPrefix, "Utah", administrativeArea); | ||
expect(lookup.include_only_administrative_area).to.equal(administrativeArea); | ||
}); | ||
it("Set include only locality param", function () { | ||
const locality = "locality"; | ||
const expectedPrefix = "z"; | ||
let lookup = new Lookup(expectedPrefix, "Utah", "test", locality); | ||
expect(lookup.include_only_locality).to.equal(locality); | ||
}); | ||
it("Set include only postal code param", function () { | ||
const postalCode = "locality"; | ||
const expectedPrefix = "z"; | ||
let lookup = new Lookup(expectedPrefix, "Utah", "test", "test", postalCode); | ||
expect(lookup.include_only_postal_code).to.equal(postalCode); | ||
}); | ||
it("Checking defaults of params on instantiation ", function () { | ||
const defaultLookup = new Lookup("", "United States", "", "", ""); | ||
let lookup = new Lookup(); | ||
expect(lookup).to.eql(defaultLookup); | ||
}); | ||
}); |
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
164228
3740