From f6500729850549e632399155d0f3b69822e28b16 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 15 Apr 2021 13:52:27 +0200 Subject: More robust tests --- server/tests/api/notifications/admin-notifications.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/tests/api/notifications/admin-notifications.ts') diff --git a/server/tests/api/notifications/admin-notifications.ts b/server/tests/api/notifications/admin-notifications.ts index e07327d74..cfe0bd2bb 100644 --- a/server/tests/api/notifications/admin-notifications.ts +++ b/server/tests/api/notifications/admin-notifications.ts @@ -3,6 +3,7 @@ import 'mocha' import { expect } from 'chai' import { MockJoinPeerTubeVersions } from '@shared/extra-utils/mock-servers/joinpeertube-versions' +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' @@ -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 () { -- cgit v1.2.3