Skip to content

Commit

Permalink
test: slight change to the way bic test works
Browse files Browse the repository at this point in the history
  • Loading branch information
hankucz committed Aug 1, 2022
1 parent 9115fae commit 73280f7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions test/finance.spec.ts
Expand Up @@ -484,13 +484,10 @@ describe('finance', () => {
describe('bic()', () => {
it('should return a random yet formally correct BIC number', () => {
const bic = faker.finance.bic();
const countryCodes = ibanLib.iso3166.join('|');
const expr = new RegExp(
`^[A-Z]{4}(${countryCodes})[A-Z0-9]{2}([A-Z0-9]{3})?\$`
);

expect(bic).toBeTypeOf('string');
expect(bic).toMatch(expr);
expect(bic).toMatch(/^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/);
expect(ibanLib.iso3166).toContain(bic.substring(4, 6));
});
});

Expand Down

0 comments on commit 73280f7

Please sign in to comment.