]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/plugins/plugin-router.ts
Translated using Weblate (French (France) (fr_FR))
[github/Chocobozzz/PeerTube.git] / server / tests / plugins / plugin-router.ts
index 1c53dd80c1900ed1a2ea3ddb6e0bfaa4e4284f16..58629adc7d6a3c38935308452f292fee32bee8a6 100644 (file)
@@ -2,19 +2,19 @@
 
 import 'mocha'
 import { expect } from 'chai'
-import { HttpStatusCode } from '@shared/core-utils'
 import {
   cleanupTests,
-  flushAndRunServer,
+  createSingleServer,
   makeGetRequest,
   makePostBodyRequest,
+  PeerTubeServer,
   PluginsCommand,
-  ServerInfo,
   setAccessTokensToServers
-} from '@shared/extra-utils'
+} from '@shared/server-commands'
+import { HttpStatusCode } from '@shared/models'
 
 describe('Test plugin helpers', function () {
-  let server: ServerInfo
+  let server: PeerTubeServer
   const basePaths = [
     '/plugins/test-five/router/',
     '/plugins/test-five/0.0.1/router/'
@@ -23,7 +23,7 @@ describe('Test plugin helpers', function () {
   before(async function () {
     this.timeout(30000)
 
-    server = await flushAndRunServer(1)
+    server = await createSingleServer(1)
     await setAccessTokensToServers([ server ])
 
     await server.plugins.install({ path: PluginsCommand.getPluginTestPath('-five') })
@@ -34,7 +34,7 @@ describe('Test plugin helpers', function () {
       const res = await makeGetRequest({
         url: server.url,
         path: path + 'ping',
-        statusCodeExpected: HttpStatusCode.OK_200
+        expectedStatus: HttpStatusCode.OK_200
       })
 
       expect(res.body.message).to.equal('pong')
@@ -47,7 +47,7 @@ describe('Test plugin helpers', function () {
         url: server.url,
         path: path + 'is-authenticated',
         token: server.accessToken,
-        statusCodeExpected: 200
+        expectedStatus: 200
       })
 
       expect(res.body.isAuthenticated).to.equal(true)
@@ -55,7 +55,7 @@ describe('Test plugin helpers', function () {
       const secRes = await makeGetRequest({
         url: server.url,
         path: path + 'is-authenticated',
-        statusCodeExpected: 200
+        expectedStatus: 200
       })
 
       expect(secRes.body.isAuthenticated).to.equal(false)
@@ -74,7 +74,7 @@ describe('Test plugin helpers', function () {
         url: server.url,
         path: path + 'form/post/mirror',
         fields: body,
-        statusCodeExpected: HttpStatusCode.OK_200
+        expectedStatus: HttpStatusCode.OK_200
       })
 
       expect(res.body).to.deep.equal(body)
@@ -88,14 +88,14 @@ describe('Test plugin helpers', function () {
       await makeGetRequest({
         url: server.url,
         path: path + 'ping',
-        statusCodeExpected: HttpStatusCode.NOT_FOUND_404
+        expectedStatus: HttpStatusCode.NOT_FOUND_404
       })
 
       await makePostBodyRequest({
         url: server.url,
         path: path + 'ping',
         fields: {},
-        statusCodeExpected: HttpStatusCode.NOT_FOUND_404
+        expectedStatus: HttpStatusCode.NOT_FOUND_404
       })
     }
   })