Skip to content

Commit

Permalink
v2.4.0 - adding Hong Kong addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Oct 21, 2020
1 parent 110a87c commit 35bfbb4
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 47 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`)
Expand Down
7 changes: 4 additions & 3 deletions DATA.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions data/china/hk-addresses-slim.min.json
Original file line number Diff line number Diff line change
@@ -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"}]}
3 changes: 3 additions & 0 deletions lib/data-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions test/australia-data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
});
});
6 changes: 3 additions & 3 deletions test/canada-data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
});
});
17 changes: 14 additions & 3 deletions test/china-data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
});
});
18 changes: 9 additions & 9 deletions test/europe-data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
});
});
48 changes: 24 additions & 24 deletions test/us-data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
});
});

0 comments on commit 35bfbb4

Please sign in to comment.