File tree 3 files changed +73
-14
lines changed
3 files changed +73
-14
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,10 @@ const sidebar = {
40
40
] ,
41
41
} ;
42
42
43
- // grab from process.env once this is building on netlify
44
43
const algolia = {
45
- apiKey : '' ,
46
- indexName : '' ,
47
- searchParameters : {
48
- facetFilters : [ '' ] ,
49
- } ,
44
+ apiKey : process . env . API_KEY ,
45
+ appId : process . env . APP_ID ,
46
+ indexName : 'fakerjs' ,
50
47
} ;
51
48
52
49
const description =
@@ -62,27 +59,42 @@ export default defineConfig({
62
59
[
63
60
'meta' ,
64
61
{
65
- property : 'og:description' ,
62
+ name : 'og:description' ,
66
63
content : description ,
67
64
} ,
65
+ ] ,
66
+ [
67
+ 'meta' ,
68
68
{
69
69
name : 'twitter:description' ,
70
70
content : description ,
71
71
} ,
72
+ ] ,
73
+ [
74
+ 'meta' ,
72
75
{
73
76
name : 'description' ,
74
77
content : description ,
75
78
} ,
79
+ ] ,
80
+ [
81
+ 'meta' ,
76
82
{
77
- property : 'og:image' ,
83
+ name : 'og:image' ,
78
84
content : image ,
79
85
} ,
86
+ ] ,
87
+ [
88
+ 'meta' ,
80
89
{
81
- property : 'twitter:image' ,
90
+ name : 'twitter:image' ,
82
91
content : image ,
83
92
} ,
93
+ ] ,
94
+ [
95
+ 'meta' ,
84
96
{
85
- property : 'twitter:card' ,
97
+ name : 'twitter:card' ,
86
98
content : 'summary_large_image' ,
87
99
} ,
88
100
] ,
@@ -96,7 +108,6 @@ export default defineConfig({
96
108
editLinkText : 'Suggest changes to this page' ,
97
109
nav,
98
110
sidebar,
99
- // TODO 2022-03-06: https://github.com/faker-js/faker/issues/222
100
- // algolia,
111
+ algolia,
101
112
} ,
102
113
} ) ;
Original file line number Diff line number Diff line change @@ -206,8 +206,12 @@ export = {
206
206
} ,
207
207
{
208
208
country : 'CR' ,
209
- total : 21 ,
209
+ total : 22 ,
210
210
bban : [
211
+ {
212
+ type : 'n' ,
213
+ count : 1 ,
214
+ } ,
211
215
{
212
216
type : 'n' ,
213
217
count : 3 ,
@@ -217,7 +221,7 @@ export = {
217
221
count : 14 ,
218
222
} ,
219
223
] ,
220
- format : 'CRkk bbbc cccc cccc cccc c ' ,
224
+ format : 'CRkk xbbb cccc cccc cccc cc ' ,
221
225
} ,
222
226
{
223
227
country : 'HR' ,
Original file line number Diff line number Diff line change @@ -255,6 +255,50 @@ describe('finance_iban', () => {
255
255
'the result should be equal to 1'
256
256
) . toBe ( 1 ) ;
257
257
} ) ;
258
+
259
+ it ( 'IBAN for Costa Rica is correct' , ( ) => {
260
+ // Costa Rica
261
+ // https://wise.com/us/iban/costa-rica
262
+ // Length 22
263
+ // BBAN 1n,3n,14n
264
+ // CRkk xbbb cccc cccc cccc cccc cccc
265
+ // x = reserve digit
266
+ // b = National bank code (digits)
267
+ // c = Account number (digits)
268
+
269
+ // example IBAN CR05 0152 0200 1026 2840 66
270
+
271
+ const iban = faker . finance . iban ( false , 'CR' ) ;
272
+
273
+ expect ( iban ) . satisfy ( validator . isIBAN ) ;
274
+
275
+ const ibanFormated = iban . match ( / .{ 1 , 4 } / g) . join ( ' ' ) ;
276
+ const bban = iban . substring ( 4 ) + iban . substring ( 0 , 4 ) ;
277
+
278
+ expect (
279
+ 22 ,
280
+ `CR IBAN would be 22 chars length, given is ${ iban . length } `
281
+ ) . toBe ( iban . length ) ;
282
+
283
+ expect (
284
+ iban . substring ( 0 , 2 ) ,
285
+ iban . substring ( 0 , 2 ) +
286
+ "must start with 'CR' in CR IBAN " +
287
+ ibanFormated
288
+ ) . to . eq ( 'CR' ) ;
289
+
290
+ expect (
291
+ iban . substring ( 2 , 22 ) ,
292
+ iban . substring ( 2 , 22 ) +
293
+ ' must contains only digit in AZ IBAN ' +
294
+ ibanFormated
295
+ ) . match ( / ^ \d { 20 } $ / ) ;
296
+
297
+ expect (
298
+ ibanLib . mod97 ( ibanLib . toDigitString ( bban ) ) ,
299
+ 'the result should be equal to 1'
300
+ ) . toBe ( 1 ) ;
301
+ } ) ;
258
302
} ) ;
259
303
}
260
304
} ) ;
You can’t perform that action at this time.
0 commit comments