From b35bb51253313f0f5522f5777ca6260b50359eb3 Mon Sep 17 00:00:00 2001 From: Guilherme Minozzi Date: Thu, 22 Sep 2022 13:55:20 -0300 Subject: [PATCH 1/2] fix(finance/bitcoinAddress): use faker.random.alphaNumeric instead for to fix min quantity of address --- src/modules/finance/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index b70950beeeb..7612eedb261 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -235,10 +235,10 @@ export class FinanceModule { let address = this.faker.helpers.arrayElement(['1', '3']); - for (let i = 0; i < addressLength - 1; i++) - address += this.faker.helpers.arrayElement( - '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'.split('') - ); + address += this.faker.random.alphaNumeric(addressLength, { + casing: 'mixed', + bannedChars: '0OIl', + }); return address; } From 4ad746769fa50175e6f26faabdd9cd67e970a73e Mon Sep 17 00:00:00 2001 From: Guilherme Minozzi Date: Thu, 22 Sep 2022 13:56:25 -0300 Subject: [PATCH 2/2] test(finance/bitcoinAddress): update snap --- test/__snapshots__/finance.spec.ts.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/__snapshots__/finance.spec.ts.snap b/test/__snapshots__/finance.spec.ts.snap index 8b23a56d048..01d2ecc121c 100644 --- a/test/__snapshots__/finance.spec.ts.snap +++ b/test/__snapshots__/finance.spec.ts.snap @@ -20,7 +20,7 @@ exports[`finance > 42 > bic > noArgs 1`] = `"UYETSCLL"`; exports[`finance > 42 > bic > with branch code 1`] = `"JUYEPSSL5G5"`; -exports[`finance > 42 > bitcoinAddress 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1bZb"`; +exports[`finance > 42 > bitcoinAddress 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1bZbB"`; exports[`finance > 42 > creditCardCVV 1`] = `"379"`; @@ -86,7 +86,7 @@ exports[`finance > 1211 > bic > noArgs 1`] = `"LXUFBTZ15O7"`; exports[`finance > 1211 > bic > with branch code 1`] = `"YLXUDE4ZXXX"`; -exports[`finance > 1211 > bitcoinAddress 1`] = `"1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsAUc9n"`; +exports[`finance > 1211 > bitcoinAddress 1`] = `"1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsAUc9nC"`; exports[`finance > 1211 > creditCardCVV 1`] = `"948"`; @@ -152,7 +152,7 @@ exports[`finance > 1337 > bic > noArgs 1`] = `"OEFHLYG1"`; exports[`finance > 1337 > bic > with branch code 1`] = `"GOEFFIJGXXX"`; -exports[`finance > 1337 > bitcoinAddress 1`] = `"3adhxs2jewAgkYgJi7No6Cn8JZar"`; +exports[`finance > 1337 > bitcoinAddress 1`] = `"3adhxs2jewAgkYgJi7No6Cn8JZarS"`; exports[`finance > 1337 > creditCardCVV 1`] = `"251"`;