From a53071dd71f19b7235778c49c00e3e1c866303f1 Mon Sep 17 00:00:00 2001 From: marihachi <marihachi0620@gmail.com> Date: Sat, 3 Apr 2021 18:08:32 +0900 Subject: [PATCH] update test --- test/main.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/main.ts b/test/main.ts index cdb05ea..7ec6303 100644 --- a/test/main.ts +++ b/test/main.ts @@ -543,10 +543,20 @@ describe('inspect API', () => { describe('extract API', () => { it('basic', () => { - const nodes = parse('abc:hoge:[tada 123:hoge:]:piyo:'); + const nodes = parse('@hoge @piyo @bebeyo'); + const expect = [ + MENTION('hoge', null, '@hoge'), + MENTION('piyo', null, '@piyo'), + MENTION('bebeyo', null, '@bebeyo') + ]; + assert.deepStrictEqual(extract(nodes, 'mention'), expect); + }); + + it('nested', () => { + const nodes = parse('abc:hoge:[tada 123 @hoge :foo:]:piyo:'); const expect = [ EMOJI_CODE('hoge'), - EMOJI_CODE('hoge'), + EMOJI_CODE('foo'), EMOJI_CODE('piyo') ]; assert.deepStrictEqual(extract(nodes, 'emojiCode'), expect); -- GitLab