aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/feeds/feeds.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/feeds/feeds.ts')
-rw-r--r--shared/extra-utils/feeds/feeds.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/shared/extra-utils/feeds/feeds.ts b/shared/extra-utils/feeds/feeds.ts
index bafbb9f94..957d4499c 100644
--- a/shared/extra-utils/feeds/feeds.ts
+++ b/shared/extra-utils/feeds/feeds.ts
@@ -13,14 +13,14 @@ function getXMLfeed (url: string, feed: FeedType, format?: string) {
13 .expect('Content-Type', /xml/) 13 .expect('Content-Type', /xml/)
14} 14}
15 15
16function getJSONfeed (url: string, feed: FeedType, query: any = {}) { 16function getJSONfeed (url: string, feed: FeedType, query: any = {}, statusCodeExpected = 200) {
17 const path = '/feeds/' + feed + '.json' 17 const path = '/feeds/' + feed + '.json'
18 18
19 return request(url) 19 return request(url)
20 .get(path) 20 .get(path)
21 .query(query) 21 .query(query)
22 .set('Accept', 'application/json') 22 .set('Accept', 'application/json')
23 .expect(200) 23 .expect(statusCodeExpected)
24 .expect('Content-Type', /json/) 24 .expect('Content-Type', /json/)
25} 25}
26 26