searchPhoneNumbersInText.test.js.map 3.5 KB

1
  1. {"version":3,"file":"searchPhoneNumbersInText.test.js","names":["describe","it","NUMBERS","searchPhoneNumbersInText","metadata","number","should","equal","shift","expectedNumbers","country","nationalNumber","startsAt","endsAt","expected","length"],"sources":["../source/searchPhoneNumbersInText.test.js"],"sourcesContent":["import searchPhoneNumbersInText from './searchPhoneNumbersInText.js'\r\nimport metadata from '../metadata.min.json' assert { type: 'json' }\r\n\r\ndescribe('searchPhoneNumbersInText', () => {\r\n\tit('should find phone numbers (with default country)', () => {\r\n\t\tconst NUMBERS = ['+78005553535', '+12133734253']\r\n\t\tfor (const number of searchPhoneNumbersInText('The number is +7 (800) 555-35-35 and not (213) 373-4253 as written in the document.', 'US', metadata)) {\r\n\t\t\tnumber.number.number.should.equal(NUMBERS[0])\r\n\t\t\tNUMBERS.shift()\r\n\t\t}\r\n\t})\r\n\r\n\tit('should find phone numbers', () => {\r\n\t\tconst NUMBERS = ['+78005553535', '+12133734253']\r\n\t\tfor (const number of searchPhoneNumbersInText('The number is +7 (800) 555-35-35 and not (213) 373-4253 as written in the document.', metadata)) {\r\n\t\t\tnumber.number.number.should.equal(NUMBERS[0])\r\n\t\t\tNUMBERS.shift()\r\n\t\t}\r\n\t})\r\n\r\n\tit('should find phone numbers in text', () => {\r\n\t\tconst expectedNumbers = [{\r\n\t\t\tcountry: 'RU',\r\n\t\t\tnationalNumber: '8005553535',\r\n\t\t\tstartsAt: 14,\r\n\t\t\tendsAt: 32\r\n\t\t}, {\r\n\t\t\tcountry: 'US',\r\n\t\t\tnationalNumber: '2133734253',\r\n\t\t\tstartsAt: 41,\r\n\t\t\tendsAt: 55\r\n\t\t}]\r\n\r\n\t\tfor (const number of searchPhoneNumbersInText('The number is +7 (800) 555-35-35 and not (213) 373-4253 as written in the document.', 'US', metadata)) {\r\n\t\t\tconst expected = expectedNumbers.shift()\r\n\t\t\tnumber.startsAt.should.equal(expected.startsAt)\r\n\t\t\tnumber.endsAt.should.equal(expected.endsAt)\r\n\t\t\tnumber.number.nationalNumber.should.equal(expected.nationalNumber)\r\n\t\t\tnumber.number.country.should.equal(expected.country)\r\n\t\t}\r\n\r\n\t\texpectedNumbers.length.should.equal(0)\r\n\t})\r\n})"],"mappings":";;AAAA;;AACA;;;;;;;;;;AAEAA,QAAQ,CAAC,0BAAD,EAA6B,YAAM;EAC1CC,EAAE,CAAC,kDAAD,EAAqD,YAAM;IAC5D,IAAMC,OAAO,GAAG,CAAC,cAAD,EAAiB,cAAjB,CAAhB;;IACA,qDAAqB,IAAAC,oCAAA,EAAyB,qFAAzB,EAAgH,IAAhH,EAAsHC,uBAAtH,CAArB,wCAAsJ;MAAA,IAA3IC,MAA2I;MACrJA,MAAM,CAACA,MAAP,CAAcA,MAAd,CAAqBC,MAArB,CAA4BC,KAA5B,CAAkCL,OAAO,CAAC,CAAD,CAAzC;MACAA,OAAO,CAACM,KAAR;IACA;EACD,CANC,CAAF;EAQAP,EAAE,CAAC,2BAAD,EAA8B,YAAM;IACrC,IAAMC,OAAO,GAAG,CAAC,cAAD,EAAiB,cAAjB,CAAhB;;IACA,sDAAqB,IAAAC,oCAAA,EAAyB,qFAAzB,EAAgHC,uBAAhH,CAArB,2CAAgJ;MAAA,IAArIC,MAAqI;MAC/IA,MAAM,CAACA,MAAP,CAAcA,MAAd,CAAqBC,MAArB,CAA4BC,KAA5B,CAAkCL,OAAO,CAAC,CAAD,CAAzC;MACAA,OAAO,CAACM,KAAR;IACA;EACD,CANC,CAAF;EAQAP,EAAE,CAAC,mCAAD,EAAsC,YAAM;IAC7C,IAAMQ,eAAe,GAAG,CAAC;MACxBC,OAAO,EAAE,IADe;MAExBC,cAAc,EAAE,YAFQ;MAGxBC,QAAQ,EAAE,EAHc;MAIxBC,MAAM,EAAE;IAJgB,CAAD,EAKrB;MACFH,OAAO,EAAE,IADP;MAEFC,cAAc,EAAE,YAFd;MAGFC,QAAQ,EAAE,EAHR;MAIFC,MAAM,EAAE;IAJN,CALqB,CAAxB;;I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