mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Move to eslint
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* tslint:disable:no-unused-expression */
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import 'mocha'
|
||||
import * as chai from 'chai'
|
||||
@@ -71,7 +71,7 @@ describe('Test create import video jobs', function () {
|
||||
const videoDetail: VideoDetails = (await getVideo(server.url, video.uuid)).body
|
||||
|
||||
expect(videoDetail.files).to.have.lengthOf(2)
|
||||
const [originalVideo, transcodedVideo] = videoDetail.files
|
||||
const [ originalVideo, transcodedVideo ] = videoDetail.files
|
||||
assertVideoProperties(originalVideo, 720, 'webm', 218910)
|
||||
assertVideoProperties(transcodedVideo, 480, 'webm', 69217)
|
||||
|
||||
@@ -95,7 +95,7 @@ describe('Test create import video jobs', function () {
|
||||
const videoDetail: VideoDetails = (await getVideo(server.url, video.uuid)).body
|
||||
|
||||
expect(videoDetail.files).to.have.lengthOf(4)
|
||||
const [originalVideo, transcodedVideo420, transcodedVideo320, transcodedVideo240] = videoDetail.files
|
||||
const [ originalVideo, transcodedVideo420, transcodedVideo320, transcodedVideo240 ] = videoDetail.files
|
||||
assertVideoProperties(originalVideo, 720, 'ogv', 140849)
|
||||
assertVideoProperties(transcodedVideo420, 480, 'mp4')
|
||||
assertVideoProperties(transcodedVideo320, 360, 'mp4')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* tslint:disable:no-unused-expression */
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import 'mocha'
|
||||
import * as chai from 'chai'
|
||||
@@ -8,14 +8,13 @@ import {
|
||||
doubleFollow,
|
||||
execCLI,
|
||||
flushAndRunMultipleServers,
|
||||
flushTests,
|
||||
getEnvCli,
|
||||
getVideo,
|
||||
getVideosList,
|
||||
killallServers,
|
||||
ServerInfo,
|
||||
setAccessTokensToServers, updateCustomSubConfig,
|
||||
uploadVideo, wait
|
||||
setAccessTokensToServers,
|
||||
updateCustomSubConfig,
|
||||
uploadVideo
|
||||
} from '../../../shared/extra-utils'
|
||||
import { waitJobs } from '../../../shared/extra-utils/server/jobs'
|
||||
|
||||
@@ -23,7 +22,7 @@ const expect = chai.expect
|
||||
|
||||
describe('Test create transcoding jobs', function () {
|
||||
let servers: ServerInfo[] = []
|
||||
let videosUUID: string[] = []
|
||||
const videosUUID: string[] = []
|
||||
|
||||
const config = {
|
||||
transcoding: {
|
||||
@@ -54,7 +53,7 @@ describe('Test create transcoding jobs', function () {
|
||||
await doubleFollow(servers[0], servers[1])
|
||||
|
||||
for (let i = 1; i <= 5; i++) {
|
||||
const res = await uploadVideo(servers[ 0 ].url, servers[ 0 ].accessToken, { name: 'video' + i })
|
||||
const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video' + i })
|
||||
videosUUID.push(res.body.video.uuid)
|
||||
}
|
||||
|
||||
@@ -90,7 +89,7 @@ describe('Test create transcoding jobs', function () {
|
||||
const res = await getVideosList(server.url)
|
||||
const videos = res.body.data
|
||||
|
||||
let infoHashes: { [ id: number ]: string }
|
||||
let infoHashes: { [id: number]: string }
|
||||
|
||||
for (const video of videos) {
|
||||
const res2 = await getVideo(server.url, video.uuid)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* tslint:disable:no-unused-expression */
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import 'mocha'
|
||||
import * as chai from 'chai'
|
||||
@@ -28,7 +28,9 @@ const expect = chai.expect
|
||||
|
||||
describe('Test optimize old videos', function () {
|
||||
let servers: ServerInfo[] = []
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
let video1UUID: string
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
let video2UUID: string
|
||||
|
||||
before(async function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* tslint:disable:no-unused-expression */
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import 'mocha'
|
||||
import { expect } from 'chai'
|
||||
@@ -6,15 +6,18 @@ import {
|
||||
addVideoChannel,
|
||||
buildAbsoluteFixturePath,
|
||||
cleanupTests,
|
||||
createUser, doubleFollow,
|
||||
createUser,
|
||||
doubleFollow,
|
||||
execCLI,
|
||||
flushAndRunServer,
|
||||
getEnvCli, getLocalIdByUUID,
|
||||
getEnvCli,
|
||||
getLocalIdByUUID,
|
||||
getVideo,
|
||||
getVideosList,
|
||||
getVideosListWithToken, removeVideo,
|
||||
removeVideo,
|
||||
ServerInfo,
|
||||
setAccessTokensToServers, uploadVideo, uploadVideoAndGetId,
|
||||
setAccessTokensToServers,
|
||||
uploadVideoAndGetId,
|
||||
userLogin,
|
||||
waitJobs
|
||||
} from '../../../shared/extra-utils'
|
||||
@@ -101,7 +104,7 @@ describe('Test CLI wrapper', function () {
|
||||
|
||||
const videos: Video[] = res.body.data
|
||||
|
||||
const video: VideoDetails = (await getVideo(server.url, videos[ 0 ].uuid)).body
|
||||
const video: VideoDetails = (await getVideo(server.url, videos[0].uuid)).body
|
||||
|
||||
expect(video.name).to.equal('test upload')
|
||||
expect(video.support).to.equal('support_text')
|
||||
@@ -250,7 +253,7 @@ describe('Test CLI wrapper', function () {
|
||||
{
|
||||
const env = getEnvCli(server)
|
||||
|
||||
const params = `list-my-redundancies`
|
||||
const params = 'list-my-redundancies'
|
||||
const stdout = await execCLI(`${env} ${cmd} redundancy ${params}`)
|
||||
|
||||
expect(stdout).to.contain('super video')
|
||||
@@ -271,7 +274,7 @@ describe('Test CLI wrapper', function () {
|
||||
|
||||
{
|
||||
const env = getEnvCli(server)
|
||||
const params = `list-my-redundancies`
|
||||
const params = 'list-my-redundancies'
|
||||
const stdout = await execCLI(`${env} ${cmd} redundancy ${params}`)
|
||||
|
||||
expect(stdout).to.not.contain('super video')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* tslint:disable:no-unused-expression */
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import 'mocha'
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* tslint:disable:no-unused-expression */
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import 'mocha'
|
||||
import * as chai from 'chai'
|
||||
@@ -11,9 +11,11 @@ import {
|
||||
execCLI,
|
||||
flushAndRunMultipleServers,
|
||||
getAccount,
|
||||
getEnvCli, makeGetRequest, makeRawRequest,
|
||||
getEnvCli,
|
||||
makeGetRequest,
|
||||
ServerInfo,
|
||||
setAccessTokensToServers, setDefaultVideoChannel,
|
||||
setAccessTokensToServers,
|
||||
setDefaultVideoChannel,
|
||||
updateMyAvatar,
|
||||
uploadVideo,
|
||||
wait
|
||||
@@ -22,7 +24,6 @@ import { Account, VideoPlaylistPrivacy } from '../../../shared/models'
|
||||
import { createFile, readdir } from 'fs-extra'
|
||||
import * as uuidv4 from 'uuid/v4'
|
||||
import { join } from 'path'
|
||||
import * as request from 'supertest'
|
||||
|
||||
const expect = chai.expect
|
||||
|
||||
@@ -61,7 +62,7 @@ async function assertCountAreOkay (servers: ServerInfo[]) {
|
||||
|
||||
describe('Test prune storage scripts', function () {
|
||||
let servers: ServerInfo[]
|
||||
const badNames: { [ directory: string ]: string[] } = {}
|
||||
const badNames: { [directory: string]: string[] } = {}
|
||||
|
||||
before(async function () {
|
||||
this.timeout(120000)
|
||||
@@ -92,20 +93,20 @@ describe('Test prune storage scripts', function () {
|
||||
|
||||
// Lazy load the remote avatar
|
||||
{
|
||||
const res = await getAccount(servers[ 0 ].url, 'root@localhost:' + servers[ 1 ].port)
|
||||
const res = await getAccount(servers[0].url, 'root@localhost:' + servers[1].port)
|
||||
const account: Account = res.body
|
||||
await makeGetRequest({
|
||||
url: servers[ 0 ].url,
|
||||
url: servers[0].url,
|
||||
path: account.avatar.path,
|
||||
statusCodeExpected: 200
|
||||
})
|
||||
}
|
||||
|
||||
{
|
||||
const res = await getAccount(servers[ 1 ].url, 'root@localhost:' + servers[ 0 ].port)
|
||||
const res = await getAccount(servers[1].url, 'root@localhost:' + servers[0].port)
|
||||
const account: Account = res.body
|
||||
await makeGetRequest({
|
||||
url: servers[ 1 ].url,
|
||||
url: servers[1].url,
|
||||
path: account.avatar.path,
|
||||
statusCodeExpected: 200
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* tslint:disable:no-unused-expression */
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import 'mocha'
|
||||
import * as chai from 'chai'
|
||||
|
||||
Reference in New Issue
Block a user