/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
import { wait } from '@shared/core-utils'
import {
cleanupTests,
waitJobs
} from '@shared/server-commands'
-const expect = chai.expect
-
describe('Test AP cleaner', function () {
let servers: PeerTubeServer[] = []
let videoUUID1: string
{
const video = await servers[0].videos.get({ id: uuid })
- expect(video.likes).to.equal(3)
+ expect(video.likes).to.equal(2)
expect(video.dislikes).to.equal(0)
}
{
- const { total } = await servers[0].comments.listThreads({ videoId: videoUUID1 })
+ const { total } = await servers[0].comments.listThreads({ videoId: uuid })
expect(total).to.equal(2)
}
}
await wait(5000)
await expectNotDeleted()
- await wait(15000)
- await expectDeleted()
+ let continueWhile = true
+
+ do {
+ try {
+ await expectDeleted()
+ continueWhile = false
+ } catch {
+ }
+ } while (continueWhile)
})
after(async function () {