summaryrefslogtreecommitdiff
path: root/test/text.js
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-28 01:26:56 +0900
committerAya Morisawa <AyaMorisawa4869@gmail.com>2017-02-28 01:44:22 +0900
commit409964adcb27c27ea6062348b2b1f48dc40a077b (patch)
tree32c0e536fca4abeacf8d91e6e90cccfe5ccb4104 /test/text.js
parentAdd comment (diff)
downloadmisskey-409964adcb27c27ea6062348b2b1f48dc40a077b.tar.gz
misskey-409964adcb27c27ea6062348b2b1f48dc40a077b.tar.bz2
misskey-409964adcb27c27ea6062348b2b1f48dc40a077b.zip
Use TypeScript for tests
Diffstat (limited to 'test/text.js')
-rw-r--r--test/text.js68
1 files changed, 0 insertions, 68 deletions
diff --git a/test/text.js b/test/text.js
deleted file mode 100644
index 78945c65a3..0000000000
--- a/test/text.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Text Tests!
- */
-
-const assert = require('assert');
-
-const analyze = require('../src/common/text');
-//const complie = require('../src/web/app/common/scripts/text-compiler');
-
-describe('Text', () => {
- it('is correctly analyzed', () => {
- const tokens = analyze('@himawari お腹ペコい #yryr');
- assert.deepEqual([
- { type: 'mention', content: '@himawari', username: 'himawari' },
- { type: 'text', content: ' お腹ペコい ' },
- { type: 'hashtag', content: '#yryr', hashtag: 'yryr' }
- ], tokens);
- });
-
- it('bold', () => {
- const tokens = analyze('**Strawberry** Pasta');
- assert.deepEqual([
- { type: 'bold', content: '**Strawberry**', bold: 'Strawberry' },
- { type: 'text', content: ' Pasta' }
- ], tokens);
- });
-
- it('mention', () => {
- const tokens = analyze('@himawari お腹ペコい');
- assert.deepEqual([
- { type: 'mention', content: '@himawari', username: 'himawari' },
- { type: 'text', content: ' お腹ペコい' }
- ], tokens);
- });
-
- it('hashtag', () => {
- const tokens = analyze('Strawberry Pasta #alice');
- assert.deepEqual([
- { type: 'text', content: 'Strawberry Pasta ' },
- { type: 'hashtag', content: '#alice', hashtag: 'alice' }
- ], tokens);
- });
-
- it('link', () => {
- const tokens = analyze('https://himasaku.net');
- assert.deepEqual([
- { type: 'link', content: 'https://himasaku.net' }
- ], tokens);
- });
-
- it('block code', () => {
- const tokens = analyze('```\nvar x = "Strawberry Pasta";\n```');
- assert.equal(tokens[0].type, 'code');
- assert.equal(tokens[0].content, '```\nvar x = "Strawberry Pasta";\n```');
- });
-
- it('inline code', () => {
- const tokens = analyze('`var x = "Strawberry Pasta";`');
- assert.equal(tokens[0].type, 'inline-code');
- assert.equal(tokens[0].content, '`var x = "Strawberry Pasta";`');
- });
-
-/*
- it('正しくコンパイルされる', () => {
- assert.equal(-1, [1,2,3].indexOf(4));
- });
-*/
-});