Skip to content

Commit

Permalink
fix: bic test
Browse files Browse the repository at this point in the history
  • Loading branch information
hankucz committed Jul 26, 2022
1 parent bbeb51d commit 9115fae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/modules/finance/index.ts
Expand Up @@ -390,7 +390,7 @@ export class Finance {
}

/**
* Generates a random SWIFT/BIC code.
* Generates a random SWIFT/BIC code based on the [ISO-9362](https://en.wikipedia.org/wiki/ISO_9362) format.
*
* @example
* faker.finance.bic() // 'WYAUPGX1432'
Expand All @@ -403,7 +403,9 @@ export class Finance {
const countryCode = this.faker.helpers.arrayElement(iban.iso3166);
const locationCode = this.faker.random.alphaNumeric(2, { casing: 'upper' });
const branchCode = this.faker.datatype.boolean()
? this.faker.random.alphaNumeric(3, { casing: 'upper' })
? this.faker.datatype.boolean()
? this.faker.random.alphaNumeric(3, { casing: 'upper' })
: 'XXX'
: '';

return `${bankIdentifier}${countryCode}${locationCode}${branchCode}`;
Expand All @@ -418,7 +420,7 @@ export class Finance {
*/
transactionDescription(): string {
const amount = this.amount();
const company = this.faker.company.companyName();
const company = this.faker.company.name();
const transactionType = this.transactionType();
const account = this.account();
const card = this.mask();
Expand Down
6 changes: 3 additions & 3 deletions test/__snapshots__/finance.spec.ts.snap
Expand Up @@ -16,7 +16,7 @@ exports[`finance > 42 > amount > with min 1`] = `"380.79"`;

exports[`finance > 42 > amount > with min and max and dec and symbol 1`] = `"$24.98160"`;

exports[`finance > 42 > bic 1`] = `"UYEOSCP1514"`;
exports[`finance > 42 > bic 1`] = `"JUYEPSSLXXX"`;

exports[`finance > 42 > bitcoinAddress 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1b"`;

Expand Down Expand Up @@ -80,7 +80,7 @@ exports[`finance > 1211 > amount > with min 1`] = `"929.24"`;

exports[`finance > 1211 > amount > with min and max and dec and symbol 1`] = `"$47.14081"`;

exports[`finance > 1211 > bic 1`] = `"LXUEBTZ1"`;
exports[`finance > 1211 > bic 1`] = `"YLXUDE4Z"`;

exports[`finance > 1211 > bitcoinAddress 1`] = `"1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsA"`;

Expand Down Expand Up @@ -144,7 +144,7 @@ exports[`finance > 1337 > amount > with min 1`] = `"269.40"`;

exports[`finance > 1337 > amount > with min and max and dec and symbol 1`] = `"$20.48098"`;

exports[`finance > 1337 > bic 1`] = `"OEFELYL1032"`;
exports[`finance > 1337 > bic 1`] = `"GOEFFIJG"`;

exports[`finance > 1337 > bitcoinAddress 1`] = `"3adhxs2jewAgkYgJi7No6Cn8JZa"`;

Expand Down

0 comments on commit 9115fae

Please sign in to comment.