Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(finance): update iso-3166-1 country codes for IBAN/BIC #168

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions src/iban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1147,15 +1147,13 @@ export = {
},
],
iso3166: [
'AC',
'AD',
'AE',
'AF',
'AG',
'AI',
'AL',
'AM',
'AN',
'AO',
'AQ',
'AR',
Expand All @@ -1182,15 +1180,13 @@ export = {
'BR',
'BS',
'BT',
'BU',
'BV',
'BW',
'BY',
'BZ',
'CA',
'CC',
'CD',
'CE',
'CF',
'CG',
'CH',
Expand All @@ -1200,40 +1196,32 @@ export = {
'CM',
'CN',
'CO',
'CP',
'CR',
'CS',
'CS',
'CU',
'CV',
'CW',
'CX',
'CY',
'CZ',
'DD',
'DE',
'DG',
'DJ',
'DK',
'DM',
'DO',
'DZ',
'EA',
'EC',
'EE',
'EG',
'EH',
'ER',
'ES',
'ET',
'EU',
'FI',
'FJ',
'FK',
'FM',
'FO',
'FR',
'FX',
'GA',
'GB',
'GD',
Expand All @@ -1259,7 +1247,6 @@ export = {
'HR',
'HT',
'HU',
'IC',
'ID',
'IE',
'IL',
Expand Down Expand Up @@ -1329,7 +1316,6 @@ export = {
'NO',
'NP',
'NR',
'NT',
'NU',
'NZ',
'OM',
Expand Down Expand Up @@ -1370,12 +1356,10 @@ export = {
'SR',
'SS',
'ST',
'SU',
'SV',
'SX',
'SY',
'SZ',
'TA',
'TC',
'TD',
'TF',
Expand Down Expand Up @@ -1407,12 +1391,11 @@ export = {
'VU',
'WF',
'WS',
'XK',
'YE',
'YT',
'YU',
'ZA',
'ZM',
'ZR',
'ZW',
],
};
16 changes: 10 additions & 6 deletions test/finance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const seedRuns = [
creditCardCVV: '251',
ethereumAddress: '0x5c346ba075bd57f5a62b82d72af39cbbb07a98cb',
iban: 'FO7710540350900318',
bic: 'OEFELTL1032',
bic: 'OEFELYL1032',
transactionDescription:
'deposit transaction at Cronin - Effertz using card ending with ***(...1830) for PEN 262.02 in account ***55239273',
},
Expand Down Expand Up @@ -473,11 +473,15 @@ describe('finance', () => {
).toStrictEqual(1);
});

it('throws an error if the passed country code is not supported', () => {
expect(() => faker.finance.iban(false, 'AA')).toThrowError(
Error('Country code AA not supported.')
);
});
it.each(['AA', 'EU'])(
'throws an error for unsupported country code "%s"',
(unsupportedCountryCode) =>
expect(() =>
faker.finance.iban(false, unsupportedCountryCode)
).toThrowError(
Error(`Country code ${unsupportedCountryCode} not supported.`)
)
);
});

describe('bic()', () => {
Expand Down