getExampleNumber.test.js 1023 B

1234567891011121314151617181920212223
  1. "use strict";
  2. var _examplesMobile = _interopRequireDefault(require("../examples.mobile.json"));
  3. var _metadataMin = _interopRequireDefault(require("../metadata.min.json"));
  4. var _getExampleNumber = _interopRequireDefault(require("./getExampleNumber.js"));
  5. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  6. describe('getExampleNumber', function () {
  7. it('should get an example number', function () {
  8. var phoneNumber = (0, _getExampleNumber["default"])('RU', _examplesMobile["default"], _metadataMin["default"]);
  9. phoneNumber.nationalNumber.should.equal('9123456789');
  10. phoneNumber.number.should.equal('+79123456789');
  11. phoneNumber.countryCallingCode.should.equal('7');
  12. phoneNumber.country.should.equal('RU');
  13. });
  14. it('should handle a non-existing country', function () {
  15. expect((0, _getExampleNumber["default"])('XX', _examplesMobile["default"], _metadataMin["default"])).to.be.undefined;
  16. });
  17. });
  18. //# sourceMappingURL=getExampleNumber.test.js.map