import 'mocha'
import { omit } from 'lodash'
-import { join } from 'path'
import { LiveVideo, VideoPrivacy } from '@shared/models'
+import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
import {
+ buildAbsoluteFixturePath,
cleanupTests,
createUser,
flushAndRunServer,
userLogin,
waitUntilLivePublished
} from '../../../../shared/extra-utils'
-import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
describe('Test video lives API validator', function () {
const path = '/api/v1/videos/live'
it('Should fail with an incorrect thumbnail file', async function () {
const fields = baseCorrectParams
const attaches = {
- thumbnailfile: join(__dirname, '..', '..', 'fixtures', 'avatar.png')
+ thumbnailfile: buildAbsoluteFixturePath('video_short.mp4')
}
await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
it('Should fail with a big thumbnail file', async function () {
const fields = baseCorrectParams
const attaches = {
- thumbnailfile: join(__dirname, '..', '..', 'fixtures', 'avatar-big.png')
+ thumbnailfile: buildAbsoluteFixturePath('preview-big.png')
}
await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
it('Should fail with an incorrect preview file', async function () {
const fields = baseCorrectParams
const attaches = {
- previewfile: join(__dirname, '..', '..', 'fixtures', 'avatar.png')
+ previewfile: buildAbsoluteFixturePath('video_short.mp4')
}
await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
it('Should fail with a big preview file', async function () {
const fields = baseCorrectParams
const attaches = {
- previewfile: join(__dirname, '..', '..', 'fixtures', 'avatar-big.png')
+ previewfile: buildAbsoluteFixturePath('preview-big.png')
}
await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
})
it('Should fail to update a live if it has already started', async function () {
- this.timeout(20000)
+ this.timeout(40000)
const resLive = await getLive(server.url, server.accessToken, videoId)
const live: LiveVideo = resLive.body
})
it('Should fail to stream twice in the save live', async function () {
- this.timeout(30000)
+ this.timeout(40000)
const resLive = await getLive(server.url, server.accessToken, videoId)
const live: LiveVideo = resLive.body