mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-15 00:56:26 +00:00
22 lines
734 B
TypeScript
22 lines
734 B
TypeScript
import { getName } from '../../test/util';
|
|
import { setEmojiConfig, unemojify } from './emoji';
|
|
|
|
describe(getName(), () => {
|
|
it('strips emojis when the config has been set accordingly', () => {
|
|
const emoji = '🚀💎';
|
|
const otherText = 'regular text';
|
|
const text = `${emoji} ${otherText}`;
|
|
setEmojiConfig({ unicodeEmoji: false });
|
|
const result = unemojify(text);
|
|
expect(result).not.toContain(emoji);
|
|
});
|
|
|
|
it('does not strip emojis when the config demands it', () => {
|
|
const emoji = '🚀💎';
|
|
const otherText = 'regular text';
|
|
const text = `${emoji} ${otherText}`;
|
|
setEmojiConfig({ unicodeEmoji: true });
|
|
const result = unemojify(text);
|
|
expect(result).toEqual(text);
|
|
});
|
|
});
|