This commit is contained in:
syuilo 2016-12-30 13:28:56 +09:00
parent 821fa8746c
commit 5024b08869
2 changed files with 23 additions and 1 deletions

View File

@ -16,7 +16,7 @@
"clean": "gulp clean",
"cleanall": "gulp cleanall",
"lint": "gulp lint",
"test": "gulp test"
"test": "mocha"
},
"dependencies": {
"@types/bcrypt": "1.0.0",
@ -96,6 +96,7 @@
"js-yaml": "3.7.0",
"livescript": "1.5.0",
"mime-types": "2.1.13",
"mocha": "3.2.0",
"mongodb": "2.2.16",
"ms": "0.7.2",
"multer": "1.2.1",

21
test/text.js Normal file
View File

@ -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));
});
*/
});