]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/utils/server/config.ts
Add stats route
[github/Chocobozzz/PeerTube.git] / server / tests / utils / server / config.ts
index b6905757a14c7d10aa482ad527497e90aecfc1d3..57f95a6033aa08376d2110a5d69f32849fc968e2 100644 (file)
@@ -1,15 +1,24 @@
-import * as request from 'supertest'
 import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../'
-import { CustomConfig } from '../../../../shared/models/config/custom-config.model'
+import { CustomConfig } from '../../../../shared/models/server/custom-config.model'
 
 function getConfig (url: string) {
   const path = '/api/v1/config'
 
-  return request(url)
-          .get(path)
-          .set('Accept', 'application/json')
-          .expect(200)
-          .expect('Content-Type', /json/)
+  return makeGetRequest({
+    url,
+    path,
+    statusCodeExpected: 200
+  })
+}
+
+function getAbout (url: string) {
+  const path = '/api/v1/config/about'
+
+  return makeGetRequest({
+    url,
+    path,
+    statusCodeExpected: 200
+  })
 }
 
 function getCustomConfig (url: string, token: string, statusCodeExpected = 200) {
@@ -52,5 +61,6 @@ export {
   getConfig,
   getCustomConfig,
   updateCustomConfig,
+  getAbout,
   deleteCustomConfig
 }