aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/server/servers.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/shared/extra-utils/server/servers.ts b/shared/extra-utils/server/servers.ts
index 5e1de6ece..6ab7bee90 100644
--- a/shared/extra-utils/server/servers.ts
+++ b/shared/extra-utils/server/servers.ts
@@ -7,6 +7,7 @@ import { join } from 'path'
7import { randomInt } from '../../core-utils/miscs/miscs' 7import { randomInt } from '../../core-utils/miscs/miscs'
8import { VideoChannel } from '../../models/videos' 8import { VideoChannel } from '../../models/videos'
9import { buildServerDirectory, getFileSize, isGithubCI, root, wait } from '../miscs/miscs' 9import { buildServerDirectory, getFileSize, isGithubCI, root, wait } from '../miscs/miscs'
10import { makeGetRequest } from '../requests/requests'
10 11
11interface ServerInfo { 12interface ServerInfo {
12 app: ChildProcess 13 app: ChildProcess
@@ -347,6 +348,14 @@ async function getServerFileSize (server: ServerInfo, subPath: string) {
347 return getFileSize(path) 348 return getFileSize(path)
348} 349}
349 350
351function makePingRequest (server: ServerInfo) {
352 return makeGetRequest({
353 url: server.url,
354 path: '/api/v1/ping',
355 statusCodeExpected: 200
356 })
357}
358
350// --------------------------------------------------------------------------- 359// ---------------------------------------------------------------------------
351 360
352export { 361export {
@@ -358,6 +367,7 @@ export {
358 cleanupTests, 367 cleanupTests,
359 flushAndRunMultipleServers, 368 flushAndRunMultipleServers,
360 flushTests, 369 flushTests,
370 makePingRequest,
361 flushAndRunServer, 371 flushAndRunServer,
362 killallServers, 372 killallServers,
363 reRunServer, 373 reRunServer,