X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fredundancy%2Fredundancy.ts;h=5abed358f99737ee3f885f25ea273f09a63a56f5;hb=8a6828b1664ce3fc535d23c54ed22bab35588d06;hp=3f228627802878531df8ffedde6d4e39bffe5557;hpb=3318147300b4f998adf728eb0a5a14a4c1829c51;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts index 3f2286278..5abed358f 100644 --- a/server/tests/api/redundancy/redundancy.ts +++ b/server/tests/api/redundancy/redundancy.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import 'mocha' -import * as chai from 'chai' +import { expect } from 'chai' import { readdir } from 'fs-extra' import magnetUtil from 'magnet-uri' import { basename, join } from 'path' @@ -26,8 +25,6 @@ import { waitJobs } from '@shared/server-commands' -const expect = chai.expect - let servers: PeerTubeServer[] = [] let video1Server2: VideoDetails @@ -53,7 +50,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition strategies.push( { min_lifetime: '1 hour', - strategy: strategy, + strategy, size: '400KB', ...additionalParams @@ -87,7 +84,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition const { id } = await servers[1].videos.upload({ attributes: { name: 'video 1 server 2' } }) video1Server2 = await servers[1].videos.get({ id }) - await servers[1].videos.view({ id }) + await servers[1].views.simulateView({ id }) } await waitJobs(servers) @@ -447,8 +444,8 @@ describe('Test videos redundancy', function () { it('Should view 2 times the first video to have > min_views config', async function () { this.timeout(80000) - await servers[0].videos.view({ id: video1Server2.uuid }) - await servers[2].videos.view({ id: video1Server2.uuid }) + await servers[0].views.simulateView({ id: video1Server2.uuid }) + await servers[2].views.simulateView({ id: video1Server2.uuid }) await wait(10000) await waitJobs(servers) @@ -516,8 +513,8 @@ describe('Test videos redundancy', function () { it('Should have 1 redundancy on the first video', async function () { this.timeout(160000) - await servers[0].videos.view({ id: video1Server2.uuid }) - await servers[2].videos.view({ id: video1Server2.uuid }) + await servers[0].views.simulateView({ id: video1Server2.uuid }) + await servers[2].views.simulateView({ id: video1Server2.uuid }) await wait(10000) await waitJobs(servers)