diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-07 14:32:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 14:32:36 +0100 |
commit | 2d53be0267acc49cda46707b885096193a1f4e9c (patch) | |
tree | 887061a34bc67f40acbb96a6278f9544bf83caeb /shared/extra-utils/feeds/feeds.ts | |
parent | adc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff) | |
download | PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip |
replace numbers with typed http status codes (#3409)
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) |