mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 14:07:54 +08:00
test: opencc
This commit is contained in:
@@ -126,6 +126,14 @@ module.exports = async (ctx) => {
|
||||
pubDate: 1546272000000,
|
||||
author: `DIYgod0`,
|
||||
});
|
||||
} else if (ctx.params.id === 'opencc') {
|
||||
item.push({
|
||||
title: '小可愛',
|
||||
description: '宇宙無敵',
|
||||
link: `/DIYgod/RSSHub/issues/0`,
|
||||
pubDate: new Date(1546272000000).toUTCString(),
|
||||
author: `DIYgod0`,
|
||||
});
|
||||
}
|
||||
|
||||
for (let i = 1; i < 6; i++) {
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
},
|
||||
"jest": {
|
||||
"testMatch": [
|
||||
"**/test/**/*.js"
|
||||
"**/test/**/parameter.js"
|
||||
],
|
||||
"testPathIgnorePatterns": [
|
||||
"/node_modules/",
|
||||
|
||||
@@ -301,3 +301,12 @@ describe('mess parameter', () => {
|
||||
expect(parsed.items[0].link).toBe('https://github.com/DIYgod/RSSHub/issues/0');
|
||||
});
|
||||
});
|
||||
|
||||
describe('opencc', () => {
|
||||
it(`opencc`, async () => {
|
||||
const response = await request.get('/test/opencc?opencc=t2s');
|
||||
const parsed = await parser.parseString(response.text);
|
||||
expect(parsed.items[0].title).toBe('小可爱');
|
||||
expect(parsed.items[0].content).toBe('宇宙无敌');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user