import test from 'tape' import nlp from '../_lib.js' const here = '[two/emoji] ' // test('keyword emojis', function (t) { // [ // ['he is so nice :heart:', ':heart:'], // [':cool: :wine_glass: yeah party', ':cool: :wine_glass:'], // ['to be or not to be: this is a question :cookie:', ':cookie:'], // ].forEach(function (a) { // const have = nlp(a[0]).match('#Emoji').text().trim() // const msg = "have: '" + have + "' want: '" + a[1] + "'" // t.equal(have, a[1], msg) // }) // t.end() // }) test('unicode emojis', function (t) { [ ['nice job 💯 ❤️', '💯 ❤️'], ['💚 good job 🎇', '💚 🎇'], ['visit Brunei', ''], ['visit Brunei 🇧🇳', '🇧🇳'], ['visit Brunei 🇧🇳🇧🇳🇧🇳', '🇧🇳🇧🇳🇧🇳'], ].forEach(function (a) { const have = nlp(a[0]).match('#Emoji').out('normal') const msg = "have: '" + have + "' want: '" + a[1] + "'" t.equal(have, a[1], here + msg) }) t.end() }) test('emoticon emojis', function (t) { [ ['nice job :)', ':)'], [';) good work', ';)'], [';( oh no :(', ';( :('], ['to be: that is th3 question', ''], ['