getExampleNumber.test.js 761 B

12345678910111213141516
  1. import examples from '../examples.mobile.json' assert { type: 'json' };
  2. import metadata from '../metadata.min.json' assert { type: 'json' };
  3. import getExampleNumber from './getExampleNumber.js';
  4. describe('getExampleNumber', function () {
  5. it('should get an example number', function () {
  6. var phoneNumber = getExampleNumber('RU', examples, metadata);
  7. phoneNumber.nationalNumber.should.equal('9123456789');
  8. phoneNumber.number.should.equal('+79123456789');
  9. phoneNumber.countryCallingCode.should.equal('7');
  10. phoneNumber.country.should.equal('RU');
  11. });
  12. it('should handle a non-existing country', function () {
  13. expect(getExampleNumber('XX', examples, metadata)).to.be.undefined;
  14. });
  15. });
  16. //# sourceMappingURL=getExampleNumber.test.js.map