Skip to content

Feature/emoji-hasEmoji#54

Merged
omnidan merged 14 commits into
omnidan:masterfrom
smeijer:feature/emoji-hasEmoji
Jul 21, 2017
Merged

Feature/emoji-hasEmoji#54
omnidan merged 14 commits into
omnidan:masterfrom
smeijer:feature/emoji-hasEmoji

Conversation

@smeijer

@smeijer smeijer commented Jul 16, 2017

Copy link
Copy Markdown

Add Emoji.hasEmoji method. This PR is build upon #53, so either that one should be merged first, or this one should be refactored.

Readme should also cover Emoji.hasEmojiByName and Emoji.hasEmojiByCode, but like I wrote in #53, I think the readme could use a general makeover. So I wanted to postpone that change, to keep the upcoming release more agile. Emoji.hasEmoji is covered by the readme update.

This PR turnes the tests below green:

describe('hasEmoji', function() {

    it('Should be able to check a emoji by :name:', function() {
      var result = emoji.hasEmoji(':heart:');
      result.should.equal(true)
    });

    it('Should be able to check a emoji by name', function() {
      var result = emoji.hasEmoji('heart');
      result.should.equal(true);
    });

    it('Should be able to check a emoji by code text form)', function() {
      var result = emoji.hasEmoji('❤');
      result.should.equal(true);
    });

    it('Should be able to check a emoji by code in variant form', function() {
      var result = emoji.hasEmoji('❤️');
      result.should.equal(true);
    });

    it('Should return false for unknown emoji names', function() {
      var result = emoji.hasEmoji(':pizza-kiss-coffee:');
      result.should.equal(false);
    });

    it('Should return false for unknown emoji codes', function() {
      var result = emoji.hasEmoji('🍕❤️‍💋‍☕');
      result.should.equal(false);
    });

  });

@omnidan

omnidan commented Jul 21, 2017

Copy link
Copy Markdown
Owner

thank you so much 😁

@omnidan omnidan merged commit 6eeaecd into omnidan:master Jul 21, 2017
@omnidan omnidan mentioned this pull request Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants