]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/plugins/plugin-unloading.ts
Implement getServerListeningConfig plugin helper
[github/Chocobozzz/PeerTube.git] / server / tests / plugins / plugin-unloading.ts
index 26a27abcae63863360ae2df2508ea09066871994..5aca1a0c01c110bd9c456bb565f5e599c10d67c2 100644 (file)
@@ -1,19 +1,25 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
 import { expect } from 'chai'
-import { HttpStatusCode } from '@shared/core-utils'
-import { cleanupTests, flushAndRunServer, makeGetRequest, PluginsCommand, ServerInfo, setAccessTokensToServers } from '@shared/extra-utils'
+import {
+  cleanupTests,
+  createSingleServer,
+  makeGetRequest,
+  PeerTubeServer,
+  PluginsCommand,
+  setAccessTokensToServers
+} from '@shared/server-commands'
+import { HttpStatusCode } from '@shared/models'
 
 describe('Test plugins module unloading', function () {
-  let server: ServerInfo = null
+  let server: PeerTubeServer = null
   const requestPath = '/plugins/test-unloading/router/get'
   let value: string = null
 
   before(async function () {
     this.timeout(30000)
 
-    server = await flushAndRunServer(1)
+    server = await createSingleServer(1)
     await setAccessTokensToServers([ server ])
 
     await server.plugins.install({ path: PluginsCommand.getPluginTestPath('-unloading') })
@@ -23,7 +29,7 @@ describe('Test plugins module unloading', function () {
     const res = await makeGetRequest({
       url: server.url,
       path: requestPath,
-      statusCodeExpected: HttpStatusCode.OK_200
+      expectedStatus: HttpStatusCode.OK_200
     })
 
     expect(res.body.message).to.match(/^\d+$/)
@@ -34,7 +40,7 @@ describe('Test plugins module unloading', function () {
     const res = await makeGetRequest({
       url: server.url,
       path: requestPath,
-      statusCodeExpected: HttpStatusCode.OK_200
+      expectedStatus: HttpStatusCode.OK_200
     })
 
     expect(res.body.message).to.be.equal(value)
@@ -46,7 +52,7 @@ describe('Test plugins module unloading', function () {
     await makeGetRequest({
       url: server.url,
       path: requestPath,
-      statusCodeExpected: HttpStatusCode.NOT_FOUND_404
+      expectedStatus: HttpStatusCode.NOT_FOUND_404
     })
   })
 
@@ -56,7 +62,7 @@ describe('Test plugins module unloading', function () {
     const res = await makeGetRequest({
       url: server.url,
       path: requestPath,
-      statusCodeExpected: HttpStatusCode.OK_200
+      expectedStatus: HttpStatusCode.OK_200
     })
 
     expect(res.body.message).to.match(/^\d+$/)