]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/notifications/admin-notifications.ts
Introduce follows command
[github/Chocobozzz/PeerTube.git] / server / tests / api / notifications / admin-notifications.ts
index e07327d74c51c873061ae403357c9d0ba725f2b5..91681c9d6ad15b52d7f3ccc9c04731c8e89822c2 100644 (file)
@@ -2,10 +2,11 @@
 
 import 'mocha'
 import { expect } from 'chai'
-import { MockJoinPeerTubeVersions } from '@shared/extra-utils/mock-servers/joinpeertube-versions'
+import { MockJoinPeerTubeVersions } from '@shared/extra-utils'
+import { PluginType } from '@shared/models'
 import { cleanupTests, installPlugin, setPluginLatestVersion, setPluginVersion, wait } from '../../../../shared/extra-utils'
 import { ServerInfo } from '../../../../shared/extra-utils/index'
-import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
+import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email'
 import {
   CheckerBaseParams,
   checkNewPeerTubeVersion,
@@ -13,7 +14,6 @@ import {
   prepareNotificationsTest
 } from '../../../../shared/extra-utils/users/user-notifications'
 import { UserNotification, UserNotificationType } from '../../../../shared/models/users'
-import { PluginType } from '@shared/models'
 
 describe('Test admin notifications', function () {
   let server: ServerInfo
@@ -26,11 +26,14 @@ describe('Test admin notifications', function () {
   before(async function () {
     this.timeout(120000)
 
+    joinPeerTubeServer = new MockJoinPeerTubeVersions()
+    const port = await joinPeerTubeServer.initialize()
+
     const config = {
       peertube: {
         check_latest_version: {
           enabled: true,
-          url: 'http://localhost:42102/versions.json'
+          url: `http://localhost:${port}/versions.json`
         }
       },
       plugins: {
@@ -66,9 +69,6 @@ describe('Test admin notifications', function () {
       accessToken: server.accessToken,
       npmName: 'peertube-theme-background-red'
     })
-
-    joinPeerTubeServer = new MockJoinPeerTubeVersions()
-    await joinPeerTubeServer.initialize()
   })
 
   describe('Latest PeerTube version notification', function () {