aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/miscs/generate.ts2
-rw-r--r--shared/extra-utils/miscs/webtorrent.ts2
-rw-r--r--shared/extra-utils/mock-servers/mock-email.ts3
-rw-r--r--shared/extra-utils/mock-servers/mock-instances-index.ts2
-rw-r--r--shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts2
-rw-r--r--shared/extra-utils/mock-servers/mock-object-storage.ts2
-rw-r--r--shared/extra-utils/mock-servers/mock-plugin-blocklist.ts4
-rw-r--r--shared/extra-utils/mock-servers/mock-proxy.ts2
-rw-r--r--shared/extra-utils/requests/requests.ts2
-rw-r--r--shared/extra-utils/videos/captions.ts2
-rw-r--r--shared/extra-utils/videos/live.ts8
11 files changed, 15 insertions, 16 deletions
diff --git a/shared/extra-utils/miscs/generate.ts b/shared/extra-utils/miscs/generate.ts
index a03a20049..3b29c0ad4 100644
--- a/shared/extra-utils/miscs/generate.ts
+++ b/shared/extra-utils/miscs/generate.ts
@@ -1,5 +1,5 @@
1import { expect } from 'chai' 1import { expect } from 'chai'
2import * as ffmpeg from 'fluent-ffmpeg' 2import ffmpeg from 'fluent-ffmpeg'
3import { ensureDir, pathExists } from 'fs-extra' 3import { ensureDir, pathExists } from 'fs-extra'
4import { dirname } from 'path' 4import { dirname } from 'path'
5import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '@server/helpers/ffprobe-utils' 5import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '@server/helpers/ffprobe-utils'
diff --git a/shared/extra-utils/miscs/webtorrent.ts b/shared/extra-utils/miscs/webtorrent.ts
index a1097effe..8fe2ad821 100644
--- a/shared/extra-utils/miscs/webtorrent.ts
+++ b/shared/extra-utils/miscs/webtorrent.ts
@@ -1,5 +1,5 @@
1import { readFile } from 'fs-extra' 1import { readFile } from 'fs-extra'
2import * as parseTorrent from 'parse-torrent' 2import parseTorrent from 'parse-torrent'
3import { basename, join } from 'path' 3import { basename, join } from 'path'
4import * as WebTorrent from 'webtorrent' 4import * as WebTorrent from 'webtorrent'
5import { VideoFile } from '@shared/models' 5import { VideoFile } from '@shared/models'
diff --git a/shared/extra-utils/mock-servers/mock-email.ts b/shared/extra-utils/mock-servers/mock-email.ts
index ffd62e325..c13d3dc0f 100644
--- a/shared/extra-utils/mock-servers/mock-email.ts
+++ b/shared/extra-utils/mock-servers/mock-email.ts
@@ -1,9 +1,8 @@
1import { ChildProcess } from 'child_process' 1import { ChildProcess } from 'child_process'
2import MailDev from 'maildev'
2import { randomInt } from '@shared/core-utils' 3import { randomInt } from '@shared/core-utils'
3import { parallelTests } from '../miscs' 4import { parallelTests } from '../miscs'
4 5
5const MailDev = require('maildev')
6
7class MockSmtpServer { 6class MockSmtpServer {
8 7
9 private static instance: MockSmtpServer 8 private static instance: MockSmtpServer
diff --git a/shared/extra-utils/mock-servers/mock-instances-index.ts b/shared/extra-utils/mock-servers/mock-instances-index.ts
index c9e33087d..2aabef9d2 100644
--- a/shared/extra-utils/mock-servers/mock-instances-index.ts
+++ b/shared/extra-utils/mock-servers/mock-instances-index.ts
@@ -1,4 +1,4 @@
1import * as express from 'express' 1import express from 'express'
2import { randomInt } from '@shared/core-utils' 2import { randomInt } from '@shared/core-utils'
3 3
4export class MockInstancesIndex { 4export class MockInstancesIndex {
diff --git a/shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts b/shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts
index 5ea432ecf..5106fc66a 100644
--- a/shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts
+++ b/shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts
@@ -1,4 +1,4 @@
1import * as express from 'express' 1import express from 'express'
2import { randomInt } from '@shared/core-utils' 2import { randomInt } from '@shared/core-utils'
3 3
4export class MockJoinPeerTubeVersions { 4export class MockJoinPeerTubeVersions {
diff --git a/shared/extra-utils/mock-servers/mock-object-storage.ts b/shared/extra-utils/mock-servers/mock-object-storage.ts
index 19ea7c87c..f1c5a6123 100644
--- a/shared/extra-utils/mock-servers/mock-object-storage.ts
+++ b/shared/extra-utils/mock-servers/mock-object-storage.ts
@@ -1,4 +1,4 @@
1import * as express from 'express' 1import express from 'express'
2import got, { RequestError } from 'got' 2import got, { RequestError } from 'got'
3import { Server } from 'http' 3import { Server } from 'http'
4import { pipeline } from 'stream' 4import { pipeline } from 'stream'
diff --git a/shared/extra-utils/mock-servers/mock-plugin-blocklist.ts b/shared/extra-utils/mock-servers/mock-plugin-blocklist.ts
index d18f8224f..6f66bf4f0 100644
--- a/shared/extra-utils/mock-servers/mock-plugin-blocklist.ts
+++ b/shared/extra-utils/mock-servers/mock-plugin-blocklist.ts
@@ -1,4 +1,4 @@
1import * as express from 'express' 1import express, { Request, Response } from 'express'
2import { Server } from 'http' 2import { Server } from 'http'
3import { randomInt } from '@shared/core-utils' 3import { randomInt } from '@shared/core-utils'
4 4
@@ -18,7 +18,7 @@ export class MockBlocklist {
18 return new Promise<number>(res => { 18 return new Promise<number>(res => {
19 const app = express() 19 const app = express()
20 20
21 app.get('/blocklist', (req: express.Request, res: express.Response) => { 21 app.get('/blocklist', (req: Request, res: Response) => {
22 return res.json(this.body) 22 return res.json(this.body)
23 }) 23 })
24 24
diff --git a/shared/extra-utils/mock-servers/mock-proxy.ts b/shared/extra-utils/mock-servers/mock-proxy.ts
index 5365f87d1..eb5f177c7 100644
--- a/shared/extra-utils/mock-servers/mock-proxy.ts
+++ b/shared/extra-utils/mock-servers/mock-proxy.ts
@@ -1,6 +1,6 @@
1 1
2import { createServer, Server } from 'http' 2import { createServer, Server } from 'http'
3import * as proxy from 'proxy' 3import proxy from 'proxy'
4import { randomInt } from '@shared/core-utils' 4import { randomInt } from '@shared/core-utils'
5 5
6class MockProxy { 6class MockProxy {
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts
index 5a2b09dcc..60a08b13c 100644
--- a/shared/extra-utils/requests/requests.ts
+++ b/shared/extra-utils/requests/requests.ts
@@ -1,7 +1,7 @@
1/* eslint-disable @typescript-eslint/no-floating-promises */ 1/* eslint-disable @typescript-eslint/no-floating-promises */
2 2
3import { decode } from 'querystring' 3import { decode } from 'querystring'
4import * as request from 'supertest' 4import request from 'supertest'
5import { URL } from 'url' 5import { URL } from 'url'
6import { HttpStatusCode } from '@shared/models' 6import { HttpStatusCode } from '@shared/models'
7import { buildAbsoluteFixturePath } from '../miscs/tests' 7import { buildAbsoluteFixturePath } from '../miscs/tests'
diff --git a/shared/extra-utils/videos/captions.ts b/shared/extra-utils/videos/captions.ts
index ff8a43366..fc44cd250 100644
--- a/shared/extra-utils/videos/captions.ts
+++ b/shared/extra-utils/videos/captions.ts
@@ -1,5 +1,5 @@
1import { expect } from 'chai' 1import { expect } from 'chai'
2import * as request from 'supertest' 2import request from 'supertest'
3import { HttpStatusCode } from '@shared/models' 3import { HttpStatusCode } from '@shared/models'
4 4
5async function testCaptionFile (url: string, captionPath: string, containsString: string) { 5async function testCaptionFile (url: string, captionPath: string, containsString: string) {
diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts
index 29f99ed6d..d3665bc90 100644
--- a/shared/extra-utils/videos/live.ts
+++ b/shared/extra-utils/videos/live.ts
@@ -1,7 +1,7 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import { expect } from 'chai' 3import { expect } from 'chai'
4import * as ffmpeg from 'fluent-ffmpeg' 4import ffmpeg, { FfmpegCommand } from 'fluent-ffmpeg'
5import { pathExists, readdir } from 'fs-extra' 5import { pathExists, readdir } from 'fs-extra'
6import { join } from 'path' 6import { join } from 'path'
7import { buildAbsoluteFixturePath, wait } from '../miscs' 7import { buildAbsoluteFixturePath, wait } from '../miscs'
@@ -50,7 +50,7 @@ function sendRTMPStream (options: {
50 return command 50 return command
51} 51}
52 52
53function waitFfmpegUntilError (command: ffmpeg.FfmpegCommand, successAfterMS = 10000) { 53function waitFfmpegUntilError (command: FfmpegCommand, successAfterMS = 10000) {
54 return new Promise<void>((res, rej) => { 54 return new Promise<void>((res, rej) => {
55 command.on('error', err => { 55 command.on('error', err => {
56 return rej(err) 56 return rej(err)
@@ -62,7 +62,7 @@ function waitFfmpegUntilError (command: ffmpeg.FfmpegCommand, successAfterMS = 1
62 }) 62 })
63} 63}
64 64
65async function testFfmpegStreamError (command: ffmpeg.FfmpegCommand, shouldHaveError: boolean) { 65async function testFfmpegStreamError (command: FfmpegCommand, shouldHaveError: boolean) {
66 let error: Error 66 let error: Error
67 67
68 try { 68 try {
@@ -77,7 +77,7 @@ async function testFfmpegStreamError (command: ffmpeg.FfmpegCommand, shouldHaveE
77 if (!shouldHaveError && error) throw error 77 if (!shouldHaveError && error) throw error
78} 78}
79 79
80async function stopFfmpeg (command: ffmpeg.FfmpegCommand) { 80async function stopFfmpeg (command: FfmpegCommand) {
81 command.kill('SIGINT') 81 command.kill('SIGINT')
82 82
83 await wait(500) 83 await wait(500)