getCountryCallingCode.test.js 543 B

12345678910111213
  1. import metadata from '../metadata.min.json' assert { type: 'json' };
  2. import getCountryCallingCode from './getCountryCallingCode.js';
  3. describe('getCountryCallingCode', function () {
  4. it('should get country calling code', function () {
  5. getCountryCallingCode('US', metadata).should.equal('1');
  6. });
  7. it('should throw if country is unknown', function () {
  8. expect(function () {
  9. return getCountryCallingCode('ZZ', metadata);
  10. }).to["throw"]('Unknown country: ZZ');
  11. });
  12. });
  13. //# sourceMappingURL=getCountryCallingCode.test.js.map