From 5024b08869c93e0ae701f5bc5f0ff5300fb1a7ec Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 30 Dec 2016 13:28:56 +0900 Subject: Add test --- test/text.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/text.js (limited to 'test') diff --git a/test/text.js b/test/text.js new file mode 100644 index 0000000000..842b900416 --- /dev/null +++ b/test/text.js @@ -0,0 +1,21 @@ +const assert = require('assert'); + +const analyze = require('../src/common/text'); +//const complie = require('../src/web/app/common/scripts/text-compiler'); + +describe('Text', () => { + it('正しく解析される', () => { + const tokens = analyze('@himawari お腹ペコい #yryr'); + assert.deepEqual([ + { type: 'mention', content: '@himawari', username: 'himawari' }, + { type: 'text', content: ' お腹ペコい ' }, + { type: 'hashtag', content: '#yryr', hashtag: 'yryr' } + ], tokens); + }); + +/* + it('正しくコンパイルされる', () => { + assert.equal(-1, [1,2,3].indexOf(4)); + }); +*/ +}); -- cgit v1.2.3-freya