diff options
Diffstat (limited to 'shared/extra-utils/feeds/feeds.ts')
-rw-r--r-- | shared/extra-utils/feeds/feeds.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/shared/extra-utils/feeds/feeds.ts b/shared/extra-utils/feeds/feeds.ts index 957d4499c..ce0a98c6d 100644 --- a/shared/extra-utils/feeds/feeds.ts +++ b/shared/extra-utils/feeds/feeds.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
2 | 3 | ||
3 | type FeedType = 'videos' | 'video-comments' | 'subscriptions' | 4 | type FeedType = 'videos' | 'video-comments' | 'subscriptions' |
4 | 5 | ||
@@ -9,11 +10,11 @@ function getXMLfeed (url: string, feed: FeedType, format?: string) { | |||
9 | .get(path) | 10 | .get(path) |
10 | .query((format) ? { format: format } : {}) | 11 | .query((format) ? { format: format } : {}) |
11 | .set('Accept', 'application/xml') | 12 | .set('Accept', 'application/xml') |
12 | .expect(200) | 13 | .expect(HttpStatusCode.OK_200) |
13 | .expect('Content-Type', /xml/) | 14 | .expect('Content-Type', /xml/) |
14 | } | 15 | } |
15 | 16 | ||
16 | function getJSONfeed (url: string, feed: FeedType, query: any = {}, statusCodeExpected = 200) { | 17 | function getJSONfeed (url: string, feed: FeedType, query: any = {}, statusCodeExpected = HttpStatusCode.OK_200) { |
17 | const path = '/feeds/' + feed + '.json' | 18 | const path = '/feeds/' + feed + '.json' |
18 | 19 | ||
19 | return request(url) | 20 | return request(url) |