1 import * as request from 'supertest'
2 import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
4 type FeedType = 'videos' | 'video-comments' | 'subscriptions'
6 function getXMLfeed (url: string, feed: FeedType, format?: string) {
7 const path = '/feeds/' + feed + '.xml'
11 .query((format) ? { format: format } : {})
12 .set('Accept', 'application/xml')
13 .expect(HttpStatusCode.OK_200)
14 .expect('Content-Type', /xml/)
17 function getJSONfeed (url: string, feed: FeedType, query: any = {}, statusCodeExpected = HttpStatusCode.OK_200) {
18 const path = '/feeds/' + feed + '.json'
23 .set('Accept', 'application/json')
24 .expect(statusCodeExpected)
25 .expect('Content-Type', /json/)
28 // ---------------------------------------------------------------------------