Skip to content

Commit 6050d7a

Browse files
authored
fix(finance): update iso-3166-1 country codes for IBAN/BIC (#168)
1 parent af3f99e commit 6050d7a

2 files changed

Lines changed: 11 additions & 24 deletions

File tree

src/iban.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,15 +1147,13 @@ export = {
11471147
},
11481148
],
11491149
iso3166: [
1150-
'AC',
11511150
'AD',
11521151
'AE',
11531152
'AF',
11541153
'AG',
11551154
'AI',
11561155
'AL',
11571156
'AM',
1158-
'AN',
11591157
'AO',
11601158
'AQ',
11611159
'AR',
@@ -1182,15 +1180,13 @@ export = {
11821180
'BR',
11831181
'BS',
11841182
'BT',
1185-
'BU',
11861183
'BV',
11871184
'BW',
11881185
'BY',
11891186
'BZ',
11901187
'CA',
11911188
'CC',
11921189
'CD',
1193-
'CE',
11941190
'CF',
11951191
'CG',
11961192
'CH',
@@ -1200,40 +1196,32 @@ export = {
12001196
'CM',
12011197
'CN',
12021198
'CO',
1203-
'CP',
12041199
'CR',
1205-
'CS',
1206-
'CS',
12071200
'CU',
12081201
'CV',
12091202
'CW',
12101203
'CX',
12111204
'CY',
12121205
'CZ',
1213-
'DD',
12141206
'DE',
1215-
'DG',
12161207
'DJ',
12171208
'DK',
12181209
'DM',
12191210
'DO',
12201211
'DZ',
1221-
'EA',
12221212
'EC',
12231213
'EE',
12241214
'EG',
12251215
'EH',
12261216
'ER',
12271217
'ES',
12281218
'ET',
1229-
'EU',
12301219
'FI',
12311220
'FJ',
12321221
'FK',
12331222
'FM',
12341223
'FO',
12351224
'FR',
1236-
'FX',
12371225
'GA',
12381226
'GB',
12391227
'GD',
@@ -1259,7 +1247,6 @@ export = {
12591247
'HR',
12601248
'HT',
12611249
'HU',
1262-
'IC',
12631250
'ID',
12641251
'IE',
12651252
'IL',
@@ -1329,7 +1316,6 @@ export = {
13291316
'NO',
13301317
'NP',
13311318
'NR',
1332-
'NT',
13331319
'NU',
13341320
'NZ',
13351321
'OM',
@@ -1370,12 +1356,10 @@ export = {
13701356
'SR',
13711357
'SS',
13721358
'ST',
1373-
'SU',
13741359
'SV',
13751360
'SX',
13761361
'SY',
13771362
'SZ',
1378-
'TA',
13791363
'TC',
13801364
'TD',
13811365
'TF',
@@ -1407,12 +1391,11 @@ export = {
14071391
'VU',
14081392
'WF',
14091393
'WS',
1394+
'XK',
14101395
'YE',
14111396
'YT',
1412-
'YU',
14131397
'ZA',
14141398
'ZM',
1415-
'ZR',
14161399
'ZW',
14171400
],
14181401
};

test/finance.spec.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const seedRuns = [
4545
creditCardCVV: '251',
4646
ethereumAddress: '0x5c346ba075bd57f5a62b82d72af39cbbb07a98cb',
4747
iban: 'FO7710540350900318',
48-
bic: 'OEFELTL1032',
48+
bic: 'OEFELYL1032',
4949
transactionDescription:
5050
'deposit transaction at Cronin - Effertz using card ending with ***(...1830) for PEN 262.02 in account ***55239273',
5151
},
@@ -473,11 +473,15 @@ describe('finance', () => {
473473
).toStrictEqual(1);
474474
});
475475

476-
it('throws an error if the passed country code is not supported', () => {
477-
expect(() => faker.finance.iban(false, 'AA')).toThrowError(
478-
Error('Country code AA not supported.')
479-
);
480-
});
476+
it.each(['AA', 'EU'])(
477+
'throws an error for unsupported country code "%s"',
478+
(unsupportedCountryCode) =>
479+
expect(() =>
480+
faker.finance.iban(false, unsupportedCountryCode)
481+
).toThrowError(
482+
Error(`Country code ${unsupportedCountryCode} not supported.`)
483+
)
484+
);
481485
});
482486

483487
describe('bic()', () => {

0 commit comments

Comments
 (0)