diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2016-12-30 13:28:56 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2016-12-30 13:28:56 +0900 |
| commit | 5024b08869c93e0ae701f5bc5f0ff5300fb1a7ec (patch) | |
| tree | e447db8ef874f81d7b4dd3f474f3f734035bc661 /test | |
| parent | v1 (diff) | |
| download | sharkey-5024b08869c93e0ae701f5bc5f0ff5300fb1a7ec.tar.gz sharkey-5024b08869c93e0ae701f5bc5f0ff5300fb1a7ec.tar.bz2 sharkey-5024b08869c93e0ae701f5bc5f0ff5300fb1a7ec.zip | |
Add test
Diffstat (limited to 'test')
| -rw-r--r-- | test/text.js | 21 |
1 files changed, 21 insertions, 0 deletions
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)); + }); +*/ +}); |