validatePhoneNumberLength.test.js.map 2.8 KB

1
  1. {"version":3,"file":"validatePhoneNumberLength.test.js","names":["validatePhoneNumberLength","parameters","push","metadata","_validatePhoneNumberLength","apply","describe","it","should","equal","expect","to","be","undefined"],"sources":["../source/validatePhoneNumberLength.test.js"],"sourcesContent":["import _validatePhoneNumberLength from './validatePhoneNumberLength.js'\r\nimport metadata from '../metadata.min.json' assert { type: 'json' }\r\n\r\nfunction validatePhoneNumberLength(...parameters) {\r\n\tparameters.push(metadata)\r\n\treturn _validatePhoneNumberLength.apply(this, parameters)\r\n}\r\n\r\ndescribe('validatePhoneNumberLength', () => {\r\n\tit('should detect whether a phone number length is valid', () => {\r\n\t\t// Not a phone number.\r\n\t\tvalidatePhoneNumberLength('+').should.equal('NOT_A_NUMBER')\r\n\t\tvalidatePhoneNumberLength('abcde').should.equal('NOT_A_NUMBER')\r\n\r\n\t\t// No country supplied for a national number.\r\n\t\tvalidatePhoneNumberLength('123').should.equal('INVALID_COUNTRY')\r\n\r\n\t\t// Too short while the number is not considered \"viable\"\r\n\t\t// by Google's `libphonenumber`.\r\n\t\tvalidatePhoneNumberLength('2', 'US').should.equal('TOO_SHORT')\r\n\t\tvalidatePhoneNumberLength('+1', 'US').should.equal('TOO_SHORT')\r\n\t\tvalidatePhoneNumberLength('+12', 'US').should.equal('TOO_SHORT')\r\n\r\n\t\t// Test national (significant) number length.\r\n\t\tvalidatePhoneNumberLength('444 1 44', 'TR').should.equal('TOO_SHORT')\r\n\t\texpect(validatePhoneNumberLength('444 1 444', 'TR')).to.be.undefined\r\n\t\tvalidatePhoneNumberLength('444 1 4444', 'TR').should.equal('INVALID_LENGTH')\r\n\t\tvalidatePhoneNumberLength('444 1 4444444444', 'TR').should.equal('TOO_LONG')\r\n\t})\r\n})"],"mappings":";;AAAA;;AACA;;;;AAEA,SAASA,yBAAT,GAAkD;EAAA,kCAAZC,UAAY;IAAZA,UAAY;EAAA;;EACjDA,UAAU,CAACC,IAAX,CAAgBC,uBAAhB;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