var localeEmoji = require('.'); describe('localeEmoji', function() { var tests = { 'de': 'πŸ‡©πŸ‡ͺ', 'de-DE': 'πŸ‡©πŸ‡ͺ', 'de_DE': 'πŸ‡©πŸ‡ͺ', 'de-CH': 'πŸ‡¨πŸ‡­', 'en': 'πŸ‡ΊπŸ‡Έ', 'EN': 'πŸ‡ΊπŸ‡Έ', 'en-GB': 'πŸ‡¬πŸ‡§', 'en-US': 'πŸ‡ΊπŸ‡Έ', 'EN-US': 'πŸ‡ΊπŸ‡Έ', 'EN-us': 'πŸ‡ΊπŸ‡Έ', 'en-us': 'πŸ‡ΊπŸ‡Έ', 'pt': 'πŸ‡§πŸ‡·', 'sk_Latin_SK': 'πŸ‡ΈπŸ‡°', 'eo': '', }; Object.keys(tests).forEach(function(from) { var to = tests[from]; it(from + ' -> ' + to, function() { expect(localeEmoji(from)).toEqual(to); }); }); it('should return a empty string for invalid input', function() { expect(localeEmoji('potato')).toEqual(''); }); });