extractCountryCallingCode.test.js 833 B

123456789101112131415161718
  1. import extractCountryCallingCode from './extractCountryCallingCode.js';
  2. import metadata from '../../metadata.min.json' assert { type: 'json' };
  3. describe('extractCountryCallingCode', function () {
  4. it('should extract country calling code from a number', function () {
  5. extractCountryCallingCode('+78005553535', null, null, metadata).should.deep.equal({
  6. countryCallingCodeSource: 'FROM_NUMBER_WITH_PLUS_SIGN',
  7. countryCallingCode: '7',
  8. number: '8005553535'
  9. });
  10. extractCountryCallingCode('+7800', null, null, metadata).should.deep.equal({
  11. countryCallingCodeSource: 'FROM_NUMBER_WITH_PLUS_SIGN',
  12. countryCallingCode: '7',
  13. number: '800'
  14. });
  15. extractCountryCallingCode('', null, null, metadata).should.deep.equal({});
  16. });
  17. });
  18. //# sourceMappingURL=extractCountryCallingCode.test.js.map