UNPKG

@legendaryrob/countrify

Version:

A package to assist in the disection of ISO-3166-1(country) and ISO-3166-2(subdivision) ISO standards.

12 lines (9 loc) 297 B
const getAlpha2 = require('../index'); describe('getAlpha2', () => { it('returns the alpha2 code from country name', () => { expect(getAlpha2('South Africa')).toBe('ZA'); }); it('returns the alpha2 code from the Alpha3 code', () => { expect(getAlpha2('ZAF')).toBe('ZA'); }); });