From 73280f7d67a6c91a4f5e89c42433200c4909f9d1 Mon Sep 17 00:00:00 2001 From: Hanna Kuczynska Date: Mon, 1 Aug 2022 15:57:24 +0200 Subject: [PATCH] test: slight change to the way bic test works --- test/finance.spec.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/finance.spec.ts b/test/finance.spec.ts index d37a4f1d842..d9149772a07 100644 --- a/test/finance.spec.ts +++ b/test/finance.spec.ts @@ -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)); }); });