mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 14:40:23 +08:00
test: fix filter_time case
This commit is contained in:
@@ -75,7 +75,7 @@ module.exports = async (ctx) => {
|
|||||||
item.push({
|
item.push({
|
||||||
title: `Title${i}`,
|
title: `Title${i}`,
|
||||||
description: `Description${i}`,
|
description: `Description${i}`,
|
||||||
pubDate: new Date(1546272000000 - i * 10 * 1000).toUTCString(),
|
pubDate: new Date((ctx.params.id === 'current_time' ? new Date() : 1546272000000) - i * 10 * 1000).toUTCString(),
|
||||||
link: `https://github.com/DIYgod/RSSHub/issues/${i}`,
|
link: `https://github.com/DIYgod/RSSHub/issues/${i}`,
|
||||||
author: `DIYgod${i}`,
|
author: `DIYgod${i}`,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ describe('filter', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it(`filter_time`, async () => {
|
it(`filter_time`, async () => {
|
||||||
const response = await request.get('/test/1?filter_time=25');
|
const response = await request.get('/test/current_time?filter_time=25');
|
||||||
const parsed = await parser.parseString(response.text);
|
const parsed = await parser.parseString(response.text);
|
||||||
expect(parsed.items.length).toBe(2);
|
expect(parsed.items.length).toBe(2);
|
||||||
expect(parsed.items[0].title).toBe('Title1');
|
expect(parsed.items[0].title).toBe('Title1');
|
||||||
|
|||||||
Reference in New Issue
Block a user