extractCountryCallingCode.test.js 1.1 KB

123456789101112131415161718192021222324
  1. "use strict";
  2. var _extractCountryCallingCode = _interopRequireDefault(require("./extractCountryCallingCode.js"));
  3. var _metadataMin = _interopRequireDefault(require("../../metadata.min.json"));
  4. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5. describe('extractCountryCallingCode', function () {
  6. it('should extract country calling code from a number', function () {
  7. (0, _extractCountryCallingCode["default"])('+78005553535', null, null, _metadataMin["default"]).should.deep.equal({
  8. countryCallingCodeSource: 'FROM_NUMBER_WITH_PLUS_SIGN',
  9. countryCallingCode: '7',
  10. number: '8005553535'
  11. });
  12. (0, _extractCountryCallingCode["default"])('+7800', null, null, _metadataMin["default"]).should.deep.equal({
  13. countryCallingCodeSource: 'FROM_NUMBER_WITH_PLUS_SIGN',
  14. countryCallingCode: '7',
  15. number: '800'
  16. });
  17. (0, _extractCountryCallingCode["default"])('', null, null, _metadataMin["default"]).should.deep.equal({});
  18. });
  19. });
  20. //# sourceMappingURL=extractCountryCallingCode.test.js.map