aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/feeds
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/utils/feeds')
-rw-r--r--server/tests/utils/feeds/feeds.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/tests/utils/feeds/feeds.ts b/server/tests/utils/feeds/feeds.ts
index 20e68cf3d..ffd23a1ad 100644
--- a/server/tests/utils/feeds/feeds.ts
+++ b/server/tests/utils/feeds/feeds.ts
@@ -1,8 +1,10 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { readFileBufferPromise } from '../../../helpers/core-utils' 2import { readFileBufferPromise } from '../../../helpers/core-utils'
3 3
4function getXMLfeed (url: string, format?: string) { 4type FeedType = 'videos' | 'video-comments'
5 const path = '/feeds/videos.xml' 5
6function getXMLfeed (url: string, feed: FeedType, format?: string) {
7 const path = '/feeds/' + feed + '.xml'
6 8
7 return request(url) 9 return request(url)
8 .get(path) 10 .get(path)
@@ -12,8 +14,8 @@ function getXMLfeed (url: string, format?: string) {
12 .expect('Content-Type', /xml/) 14 .expect('Content-Type', /xml/)
13} 15}
14 16
15function getJSONfeed (url: string) { 17function getJSONfeed (url: string, feed: FeedType) {
16 const path = '/feeds/videos.json' 18 const path = '/feeds/' + feed + '.json'
17 19
18 return request(url) 20 return request(url)
19 .get(path) 21 .get(path)