From 2d53be0267acc49cda46707b885096193a1f4e9c Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 7 Dec 2020 14:32:36 +0100 Subject: replace numbers with typed http status codes (#3409) --- shared/extra-utils/feeds/feeds.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'shared/extra-utils/feeds') 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 @@ import * as request from 'supertest' +import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' type FeedType = 'videos' | 'video-comments' | 'subscriptions' @@ -9,11 +10,11 @@ function getXMLfeed (url: string, feed: FeedType, format?: string) { .get(path) .query((format) ? { format: format } : {}) .set('Accept', 'application/xml') - .expect(200) + .expect(HttpStatusCode.OK_200) .expect('Content-Type', /xml/) } -function getJSONfeed (url: string, feed: FeedType, query: any = {}, statusCodeExpected = 200) { +function getJSONfeed (url: string, feed: FeedType, query: any = {}, statusCodeExpected = HttpStatusCode.OK_200) { const path = '/feeds/' + feed + '.json' return request(url) -- cgit v1.2.3