-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v2.5.0 - overhauled testing framework
- Loading branch information
1 parent
90a7d72
commit edee3dd
Showing
14 changed files
with
394 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
/* eslint-env node, mocha */ | ||
const assert = require('assert'); | ||
const assert = require('chai').assert | ||
const expect = require('chai').expect | ||
const dad = require('../index') | ||
|
||
describe('Australia Data', () => { | ||
it('returns a VT address', () => { | ||
const address = dad.random('AU_VT') | ||
assert.strictEqual(address.state, 'VIC'); | ||
describe('AU VT Address Data', function () { | ||
const address = dad.random('AU_VT') | ||
const addresses = dad.list('AU_VT') | ||
|
||
it('returns a random VT address', function () { | ||
assert.equal(address.state, 'VIC'); | ||
}); | ||
|
||
it('returns a list of VT addresses', () => { | ||
const addresses = dad.list('AU_VT') | ||
assert.strictEqual(addresses.addresses.length, 5); | ||
var i | ||
while (i <= addresses.length) { | ||
assert.strictEqual(addresses.addresses[i].state, 'VIC') | ||
} | ||
it('returns a list of VT addresses with a length of 5', function () { | ||
assert.equal(addresses.addresses.length, 5); | ||
}) | ||
|
||
addresses.addresses.forEach(function (singleAddress) { | ||
it(`returns "${singleAddress.street1}" from a list of VT addresses`, function () { | ||
assert.equal(singleAddress.state, 'VIC') | ||
}); | ||
}) | ||
|
||
addresses.addresses.forEach(function (singleAddress) { | ||
it(`ensures the data structure of "${singleAddress.street1}" is uniform`, function () { | ||
expect(singleAddress).to.contain.all.keys('street1', 'street2', 'city', 'state', 'zip', 'country'); | ||
}); | ||
}); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
/* eslint-env node, mocha */ | ||
const assert = require('assert'); | ||
const assert = require('chai').assert | ||
const expect = require('chai').expect | ||
const dad = require('../index') | ||
|
||
describe('Canada Data', () => { | ||
it('returns a BC address', () => { | ||
const address = dad.random('CA_BC') | ||
assert.strictEqual(address.state, 'BC'); | ||
describe('CA BC Address Data', function () { | ||
const address = dad.random('CA_BC') | ||
const addresses = dad.list('CA_BC') | ||
|
||
it('returns a random BC address', function () { | ||
assert.equal(address.state, 'BC'); | ||
}); | ||
|
||
it('returns a list of BC addresses', () => { | ||
const addresses = dad.list('CA_BC') | ||
assert.strictEqual(addresses.addresses.length, 5); | ||
var i | ||
while (i <= addresses.length) { | ||
assert.strictEqual(addresses.addresses[i].state, 'BC') | ||
} | ||
it('returns a list of BC addresses with a length of 5', function () { | ||
assert.equal(addresses.addresses.length, 5); | ||
}) | ||
|
||
addresses.addresses.forEach(function (singleAddress) { | ||
it(`returns "${singleAddress.street1}" from a list of BC addresses`, function () { | ||
assert.equal(singleAddress.state, 'BC') | ||
}); | ||
}) | ||
|
||
addresses.addresses.forEach(function (singleAddress) { | ||
it(`ensures the data structure of "${singleAddress.street1}" is uniform`, function () { | ||
expect(singleAddress).to.contain.all.keys('street1', 'street2', 'city', 'state', 'zip', 'country'); | ||
}); | ||
}); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,54 @@ | ||
/* eslint-env node, mocha */ | ||
const assert = require('assert'); | ||
const assert = require('chai').assert | ||
const expect = require('chai').expect | ||
const dad = require('../index') | ||
|
||
describe('China Data', () => { | ||
it('returns a BJ address', () => { | ||
const address = dad.random('CN_BJ') | ||
assert.strictEqual(address.country, 'CN'); | ||
describe('CN BJ Address Data', function () { | ||
const address = dad.random('CN_BJ') | ||
const addresses = dad.list('CN_BJ') | ||
|
||
it('returns a random BJ address', function () { | ||
assert.equal(address.country, 'CN'); | ||
}); | ||
|
||
it('returns a list of BJ addresses', () => { | ||
const addresses = dad.list('CN_BJ') | ||
assert.strictEqual(addresses.addresses.length, 5); | ||
var i | ||
while (i <= addresses.length) { | ||
assert.strictEqual(addresses.addresses[i].country, 'CN') | ||
} | ||
it('returns a list of BJ addresses with a length of 5', function () { | ||
assert.equal(addresses.addresses.length, 5); | ||
}) | ||
|
||
addresses.addresses.forEach(function (singleAddress) { | ||
it(`returns "${singleAddress.street1}" from a list of BJ addresses`, function () { | ||
assert.equal(singleAddress.country, 'CN') | ||
}); | ||
}) | ||
|
||
addresses.addresses.forEach(function (singleAddress) { | ||
it(`ensures the data structure of "${singleAddress.street1}" is uniform`, function () { | ||
expect(singleAddress).to.contain.all.keys('street1', 'street2', 'city', 'state', 'zip', 'country'); | ||
}); | ||
}); | ||
}) | ||
|
||
it('returns a HK address', () => { | ||
const address = dad.random('CN_HK') | ||
assert.strictEqual(address.state, 'Hong Kong'); | ||
describe('CN HK Address Data', function () { | ||
const address = dad.random('CN_HK') | ||
const addresses = dad.list('CN_HK') | ||
|
||
it('returns a random HK address', function () { | ||
assert.equal(address.state, 'Hong Kong'); | ||
}); | ||
|
||
it('returns a list of HK addresses', () => { | ||
const addresses = dad.list('CN_HK') | ||
assert.strictEqual(addresses.addresses.length, 5); | ||
var i | ||
while (i <= addresses.length) { | ||
assert.strictEqual(addresses.addresses[i].state, 'Hong Kong') | ||
} | ||
it('returns a list of HK addresses with a length of 5', function () { | ||
assert.equal(addresses.addresses.length, 5); | ||
}) | ||
|
||
addresses.addresses.forEach(function (singleAddress) { | ||
it(`returns "${singleAddress.street1}" from a list of HK addresses`, function () { | ||
assert.equal(singleAddress.state, 'Hong Kong') | ||
}); | ||
}) | ||
|
||
addresses.addresses.forEach(function (singleAddress) { | ||
it(`ensures the data structure of "${singleAddress.street1}" is uniform`, function () { | ||
expect(singleAddress).to.contain.all.keys('street1', 'street2', 'city', 'state', 'zip', 'country'); | ||
}); | ||
}); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
/* eslint-env node, mocha */ | ||
const assert = require('assert'); | ||
const assert = require('chai').assert | ||
const dad = require('../index') | ||
|
||
describe('Bad Data', () => { | ||
it('returns an error when bad data is passed', () => { | ||
describe('Bad Data', function () { | ||
it('returns an error when bad data is passed', function () { | ||
assert.throws(() => { dad.random('BAD_DATA') }, Error); | ||
}); | ||
|
||
it('returns an error when no data is passed', () => { | ||
it('returns an error when no data is passed', function () { | ||
assert.throws(() => { dad.random() }, Error); | ||
}); | ||
}); |
Oops, something went wrong.