aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarak <[email protected]>2021-02-04 17:39:06 -0500
committerGitHub <[email protected]>2021-02-04 17:39:06 -0500
commit90fc05df437f5193bfc9e759bd94a4c8917d4bde (patch)
tree055274cce7aae5a07ad3f80d3cf45814dfe2203e /test
parente61e8455c45555786ff10e5c9f15b85cf91f66ef (diff)
parentb4c3c745632bbdcc09fc35fc3bdcbfe601e2cf91 (diff)
downloadfaker-90fc05df437f5193bfc9e759bd94a4c8917d4bde.tar.xz
faker-90fc05df437f5193bfc9e759bd94a4c8917d4bde.zip
Merge pull request #989 from rebuy-de/patch-iban-country
Add optional country code parameter for iban method
Diffstat (limited to 'test')
-rw-r--r--test/finance.unit.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/finance.unit.js b/test/finance.unit.js
index 0e5e6624..f22a073a 100644
--- a/test/finance.unit.js
+++ b/test/finance.unit.js
@@ -351,6 +351,17 @@ describe('finance.js', function () {
assert.equal(ibanLib.mod97(ibanLib.toDigitString(bban)), 1, "the result should be equal to 1");
});
+ it("returns a specific and formally correct IBAN number", function () {
+ var iban = faker.finance.iban(false, "DE");
+ var bban = iban.substring(4) + iban.substring(0, 4);
+ var countryCode = iban.substring(0, 2);
+
+ assert.equal(countryCode, "DE");
+ assert.equal(ibanLib.mod97(ibanLib.toDigitString(bban)), 1, "the result should be equal to 1");
+ });
+ it("throws an error if the passed country code is not supported", function () {
+ assert.throws(function() { faker.finance.iban(false, 'AA');}, /Country code AA not supported/);
+ });
});
describe("bic()", function () {