isPossiblePhoneNumber.test.js.map 2.8 KB

1
  1. {"version":3,"file":"isPossiblePhoneNumber.test.js","names":["isPossiblePhoneNumber","parameters","push","metadata","_isPossiblePhoneNumber","apply","describe","it","should","equal","defaultCountry","expect","oldMetadata","to"],"sources":["../source/isPossiblePhoneNumber.test.js"],"sourcesContent":["import _isPossiblePhoneNumber from './isPossiblePhoneNumber.js'\r\nimport metadata from '../metadata.min.json' assert { type: 'json' }\r\nimport oldMetadata from '../test/metadata/1.0.0/metadata.min.json' assert { type: 'json' }\r\n\r\nfunction isPossiblePhoneNumber(...parameters) {\r\n\tparameters.push(metadata)\r\n\treturn _isPossiblePhoneNumber.apply(this, parameters)\r\n}\r\n\r\ndescribe('isPossiblePhoneNumber', () => {\r\n\tit('should detect whether a phone number is possible', () => {\r\n\t\tisPossiblePhoneNumber('8 (800) 555 35 35', 'RU').should.equal(true)\r\n\t\tisPossiblePhoneNumber('8 (800) 555 35 35 0', 'RU').should.equal(false)\r\n\t\tisPossiblePhoneNumber('Call: 8 (800) 555 35 35', 'RU').should.equal(false)\r\n\t\tisPossiblePhoneNumber('8 (800) 555 35 35', { defaultCountry: 'RU' }).should.equal(true)\r\n\t\tisPossiblePhoneNumber('+7 (800) 555 35 35').should.equal(true)\r\n\t\tisPossiblePhoneNumber('+7 1 (800) 555 35 35').should.equal(false)\r\n\t\tisPossiblePhoneNumber(' +7 (800) 555 35 35').should.equal(false)\r\n\t\tisPossiblePhoneNumber(' ').should.equal(false)\r\n\t})\r\n\r\n\tit('should detect whether a phone number is possible when using old metadata', () => {\r\n\t\texpect(() => _isPossiblePhoneNumber('8 (800) 555 35 35', 'RU', oldMetadata))\r\n\t\t\t.to.throw('Missing \"possibleLengths\" in metadata.')\r\n\t\t_isPossiblePhoneNumber('+888 123 456 78901', oldMetadata).should.equal(true)\r\n\t})\r\n})"],"mappings":";;AAAA;;AACA;;AACA;;;;AAEA,SAASA,qBAAT,GAA8C;EAAA,kCAAZC,UAAY;IAAZA,UAAY;EA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