Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('filter: emoji', () => {
const base = twemoji.base;
beforeEach(() => {
angular.module('emoji', []).filter('emoji', emojiFilter);
angular.mock.module('emoji');
});
it('should convert an unicode heart to an image', angular.mock.inject(emojiFilter => {
const html = emojiFilter('I \u2764 emoji!');
expect(html).toBe(`I <img src="${base}72x72/2764.png" alt="\u2764" draggable="false" class="emoji"> emoji!`);
}));
});
localTwemoji() {
Twemoji.base = `${process.env.baseUrl}/emoji/`;
return Twemoji;
},
'twemoji-url': function(emoji) {
const codePoint = twemoji.convert.toCodePoint(emoji.getValue());
return sassTypes.String(`url(${twemoji.base}svg/${codePoint}.svg)`);
}
}