2018-03-01 22:19:59 +08:00
|
|
|
import { expect } from 'chai';
|
2018-03-15 16:40:11 +08:00
|
|
|
import { lookup } from './translate';
|
|
|
|
|
import { kernelText } from './utils';
|
2018-03-01 22:19:59 +08:00
|
|
|
|
|
|
|
|
|
2018-03-02 08:08:39 +08:00
|
|
|
describe('根据字典进行翻译', () => {
|
2018-03-02 14:25:07 +08:00
|
|
|
it('抽取核心字符', function () {
|
2018-03-07 09:08:44 +08:00
|
|
|
expect(kernelText(' # Forms ABC. ')).eql('#FormsABC');
|
2018-03-02 14:25:07 +08:00
|
|
|
});
|
|
|
|
|
|
2018-03-02 08:08:39 +08:00
|
|
|
it('查字典', () => {
|
2018-03-01 22:19:59 +08:00
|
|
|
expect(lookup('# Forms')[0].translation).eql('# 表单');
|
|
|
|
|
});
|
2018-03-03 21:05:33 +08:00
|
|
|
|
|
|
|
|
it('对包裹在 a 标签中的内容查字典', () => {
|
|
|
|
|
});
|
2018-03-01 22:19:59 +08:00
|
|
|
});
|