Skip to content

Commit

Permalink
Update regex for Emoji 13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jdecked committed May 28, 2021
1 parent 66059e5 commit 2c193ce
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ dist
node_modules
yarn-error.log
.npmrc
PROJECT
.cache
.pants.d
.pids
.pants.workdir.file_lock
.pants.workdir.file_lock.lock_message
.cache
.pids
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"license": "MIT",
"name": "twemoji-parser",
"version": "13.0.0",
"version": "13.1.0",
"description": "Parser for identifying Twemoji in text",
"main": "dist/index.js",
"files": [
Expand Down
58 changes: 58 additions & 0 deletions src/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,4 +709,62 @@ describe('version spot checks', () => {
]);
});
});

describe('Emoji 13.1', () => {
test('Face exhaling', () => {
expect(parse('\ud83d\ude2e\u200d\ud83d\udca8')).toMatchObject([
{
indices: [0, 5],
text: '\ud83d\ude2e\u200d\ud83d\udca8'
}
]);
});

test('Face in clouds', () => {
expect(parse('\ud83d\ude36\u200d\ud83c\udf2b\ufe0f')).toMatchObject([
{
indices: [0, 6],
text: '\ud83d\ude36\u200d\ud83c\udf2b\ufe0f'
}
]);
});

test('Bearded woman', () => {
expect(parse('\ud83e\uddd4\u200d\u2640\ufe0f')).toMatchObject([
{
indices: [0, 5],
text: '\ud83e\uddd4\u200d\u2640\ufe0f'
}
]);
});

test('Couple with heart and different skintones', () => {
expect(parse('\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c\udffb')).toMatchObject([
{
indices: [0, 12],
text: '\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c\udffb'
}
]);
});

test('Couple kissing with different skintones', () => {
expect(
parse('\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c\udffd')
).toMatchObject([
{
indices: [0, 15],
text: '\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c\udffd'
}
]);
});

test('Heart on fire', () => {
expect(parse('\u2764\ufe0f\u200d\ud83d\udd25')).toMatchObject([
{
indices: [0, 5],
text: '\u2764\ufe0f\u200d\ud83d\udd25'
}
]);
});
});
});

0 comments on commit 2c193ce

Please sign in to comment.