diff --git a/CHANGELOG.md b/CHANGELOG.md index 911d2ca..366142f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v2.4.0 (2020-10-21) + +* Added `China - Honk Kong` addresses + ## v2.3.2 (2020-08-15) * Switched coverage reporting commands and packages (switched `istanbul` to `nyc`) diff --git a/DATA.md b/DATA.md index 28ca514..f074749 100644 --- a/DATA.md +++ b/DATA.md @@ -22,9 +22,10 @@ All of these files will be found in the `data/canada` directory. All of these files will be found in the `data/china` directory. -| Filename | Locations | Address Count | Tag | -| -------------------------- | --------------- | ------------- | ------ | -| bj-addresses-slim.min.json | Beijing Area | 5 | CN_BJ | +| Filename | Locations | Address Count | Tag | +| -------------------------- | ------------------------- | ------------- | ------ | +| bj-addresses-slim.min.json | Beijing Area | 5 | CN_BJ | +| hk-addresses-slim.min.json | Hong Kong - Wan Chai Area | 5 | CN_HK | ## Europe diff --git a/data/china/hk-addresses-slim.min.json b/data/china/hk-addresses-slim.min.json new file mode 100644 index 0000000..70751f4 --- /dev/null +++ b/data/china/hk-addresses-slim.min.json @@ -0,0 +1 @@ +{"addresses":[{"street1":"1 Expo Drive","street2":"","city":"WAN CHAI","state":"Hong Kong","zip":"","country":"CN"},{"street1":"12 Harbour Road","street2":"","city":"Wan Chai","state":"Hong Kong","zip":"","country":"CN"},{"street1":"66 Gloucester Road","street2":"","city":"Wan Chai","state":"Hong Kong","zip":"","country":"CN"},{"street1":"2 Tim Mei Avenue","street2":"","city":"Wan Chai","state":"Hong Kong","zip":"","country":"CN"},{"street1":"5 Edinburgh Place","street2":"","city":"Wan Chai","state":"Hong Kong","zip":"","country":"CN"}]} \ No newline at end of file diff --git a/lib/data-router.js b/lib/data-router.js index ea133de..8e4a685 100644 --- a/lib/data-router.js +++ b/lib/data-router.js @@ -29,6 +29,9 @@ function variables(data) { case 'CN_BJ': addresses = `${location}${china}bj${nameScheme}` break; + case 'CN_HK': + addresses = `${location}${china}hk${nameScheme}` + break; case 'EU_DE': addresses = `${location}${europe}de${nameScheme}` break; diff --git a/package-lock.json b/package-lock.json index 161704c..72b59dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "dad-tool", - "version": "2.3.1", + "version": "2.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d74bf43..31df50b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dad-tool", - "version": "2.3.2", + "version": "2.4.0", "description": "Dummy Address Data (DAD) allows you to query a massive dataset for real addresses that are perfect for dummy data.", "main": "index.js", "scripts": { diff --git a/test/australia-data.test.js b/test/australia-data.test.js index 7145412..5b785b7 100644 --- a/test/australia-data.test.js +++ b/test/australia-data.test.js @@ -5,12 +5,12 @@ const dad = require('../index') describe('Australia Data', () => { it('returns a VT address', () => { const address = dad.random('AU_VT') - assert.equal(address.state, 'VIC'); + assert.strictEqual(address.state, 'VIC'); }); it('returns a list of VT addresses', () => { const addresses = dad.list('AU_VT') - assert.equal(addresses.addresses.length, 5); - assert.equal(addresses.addresses[0].state, 'VIC') + assert.strictEqual(addresses.addresses.length, 5); + assert.strictEqual(addresses.addresses[0].state, 'VIC') }); }); diff --git a/test/canada-data.test.js b/test/canada-data.test.js index 27c1258..ab4289e 100644 --- a/test/canada-data.test.js +++ b/test/canada-data.test.js @@ -5,12 +5,12 @@ const dad = require('../index') describe('Canada Data', () => { it('returns a BC address', () => { const address = dad.random('CA_BC') - assert.equal(address.state, 'BC'); + assert.strictEqual(address.state, 'BC'); }); it('returns a list of BC addresses', () => { const addresses = dad.list('CA_BC') - assert.equal(addresses.addresses.length, 5); - assert.equal(addresses.addresses[0].state, 'BC') + assert.strictEqual(addresses.addresses.length, 5); + assert.strictEqual(addresses.addresses[0].state, 'BC') }); }); diff --git a/test/china-data.test.js b/test/china-data.test.js index 7d05854..91b6a9c 100644 --- a/test/china-data.test.js +++ b/test/china-data.test.js @@ -5,12 +5,23 @@ const dad = require('../index') describe('China Data', () => { it('returns a BJ address', () => { const address = dad.random('CN_BJ') - assert.equal(address.country, 'CN'); + assert.strictEqual(address.country, 'CN'); }); it('returns a list of BJ addresses', () => { const addresses = dad.list('CN_BJ') - assert.equal(addresses.addresses.length, 5); - assert.equal(addresses.addresses[0].country, 'CN') + assert.strictEqual(addresses.addresses.length, 5); + assert.strictEqual(addresses.addresses[0].country, 'CN') + }); + + it('returns a HK address', () => { + const address = dad.random('CN_HK') + assert.strictEqual(address.state, 'Hong Kong'); + }); + + it('returns a list of HK addresses', () => { + const addresses = dad.list('CN_HK') + assert.strictEqual(addresses.addresses.length, 5); + assert.strictEqual(addresses.addresses[0].state, 'Hong Kong') }); }); diff --git a/test/europe-data.test.js b/test/europe-data.test.js index afaf7fe..551d878 100644 --- a/test/europe-data.test.js +++ b/test/europe-data.test.js @@ -5,34 +5,34 @@ const dad = require('../index') describe('Europe Data', () => { it('returns a DE address', () => { const address = dad.random('EU_DE') - assert.equal(address.country, 'DE'); + assert.strictEqual(address.country, 'DE'); }); it('returns a list of DE addresses', () => { const addresses = dad.list('EU_DE') - assert.equal(addresses.addresses.length, 5); - assert.equal(addresses.addresses[0].country, 'DE') + assert.strictEqual(addresses.addresses.length, 5); + assert.strictEqual(addresses.addresses[0].country, 'DE') }); it('returns a ES address', () => { const address = dad.random('EU_ES') - assert.equal(address.country, 'ES'); + assert.strictEqual(address.country, 'ES'); }); it('returns a list of ES addresses', () => { const addresses = dad.list('EU_ES') - assert.equal(addresses.addresses.length, 5); - assert.equal(addresses.addresses[0].country, 'ES') + assert.strictEqual(addresses.addresses.length, 5); + assert.strictEqual(addresses.addresses[0].country, 'ES') }); it('returns a UK address', () => { const address = dad.random('EU_UK') - assert.equal(address.country, 'UK'); + assert.strictEqual(address.country, 'UK'); }); it('returns a list of UK addresses', () => { const addresses = dad.list('EU_UK') - assert.equal(addresses.addresses.length, 5); - assert.equal(addresses.addresses[0].country, 'UK') + assert.strictEqual(addresses.addresses.length, 5); + assert.strictEqual(addresses.addresses[0].country, 'UK') }); }); diff --git a/test/us-data.test.js b/test/us-data.test.js index 7a4876d..d44b5d9 100644 --- a/test/us-data.test.js +++ b/test/us-data.test.js @@ -6,95 +6,95 @@ describe('United States Data', () => { // US Midwest it('returns a KS address', () => { const address = dad.random('US_KS') - assert.equal(address.state, 'KS'); + assert.strictEqual(address.state, 'KS'); }); it('returns a list of KS addresses', () => { const addresses = dad.list('US_KS') - assert.equal(addresses.addresses.length, 100); - assert.equal(addresses.addresses[0].state, 'KS') + assert.strictEqual(addresses.addresses.length, 100); + assert.strictEqual(addresses.addresses[0].state, 'KS') }); // US Northeast it('returns a NY address', () => { const address = dad.random('US_NY') - assert.equal(address.state, 'NY'); + assert.strictEqual(address.state, 'NY'); }); it('returns a list of NY addresses', () => { const addresses = dad.list('US_NY') - assert.equal(addresses.addresses.length, 100); - assert.equal(addresses.addresses[0].state, 'NY') + assert.strictEqual(addresses.addresses.length, 100); + assert.strictEqual(addresses.addresses[0].state, 'NY') }); // US South it('returns a TX address', () => { const address = dad.random('US_TX') - assert.equal(address.state, 'TX'); + assert.strictEqual(address.state, 'TX'); }); it('returns a list of TX addresses', () => { const addresses = dad.list('US_TX') - assert.equal(addresses.addresses.length, 100); - assert.equal(addresses.addresses[0].state, 'TX') + assert.strictEqual(addresses.addresses.length, 100); + assert.strictEqual(addresses.addresses[0].state, 'TX') }); // US West it('returns a CA address', () => { const address = dad.random('US_CA') - assert.equal(address.state, 'CA'); + assert.strictEqual(address.state, 'CA'); }); it('returns a list of CA addresses', () => { const addresses = dad.list('US_CA') - assert.equal(addresses.addresses.length, 100); - assert.equal(addresses.addresses[0].state, 'CA') + assert.strictEqual(addresses.addresses.length, 100); + assert.strictEqual(addresses.addresses[0].state, 'CA') }); it('returns a NV address', () => { const address = dad.random('US_NV') - assert.equal(address.state, 'NV'); + assert.strictEqual(address.state, 'NV'); }); it('returns a list of NV addresses', () => { const addresses = dad.list('US_NV') - assert.equal(addresses.addresses.length, 100); - assert.equal(addresses.addresses[0].state, 'NV') + assert.strictEqual(addresses.addresses.length, 100); + assert.strictEqual(addresses.addresses[0].state, 'NV') }); it('returns a OR address', () => { const address = dad.random('US_OR') - assert.equal(address.state, 'OR'); + assert.strictEqual(address.state, 'OR'); }); it('returns a list of OR addresses', () => { const addresses = dad.list('US_OR') - assert.equal(addresses.addresses.length, 100); - assert.equal(addresses.addresses[0].state, 'OR') + assert.strictEqual(addresses.addresses.length, 100); + assert.strictEqual(addresses.addresses[0].state, 'OR') }); it('returns a UT address', () => { const address = dad.random('US_UT') - assert.equal(address.state, 'UT'); + assert.strictEqual(address.state, 'UT'); }); it('returns a list of UT addresses', () => { const addresses = dad.list('US_UT') - assert.equal(addresses.addresses.length, 100); - assert.equal(addresses.addresses[0].state, 'UT') + assert.strictEqual(addresses.addresses.length, 100); + assert.strictEqual(addresses.addresses[0].state, 'UT') }); it('returns a WA address', () => { const address = dad.random('US_WA') - assert.equal(address.state, 'WA'); + assert.strictEqual(address.state, 'WA'); }); it('returns a list of WA addresses', () => { const addresses = dad.list('US_WA') - assert.equal(addresses.addresses.length, 100); - assert.equal(addresses.addresses[0].state, 'WA') + assert.strictEqual(addresses.addresses.length, 100); + assert.strictEqual(addresses.addresses[0].state, 'WA') }); });